#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define per(i,l,r) for(int i=(l);i>=(r);i--)
#define SZ(a) ((int)a.size())
#define pb push_back
#define fir first
#define sec second
#define pii pair<int,int>

inline int read(){
    int x=0,f=0;char ch=getchar();
    while(!isdigit(ch))f|=ch=='-',ch=getchar();
    while(isdigit(ch))x=10*x+ch-'0',ch=getchar();
    return f?-x:x;
}
template<typename T> void print(T x){
    if(x<0)putchar('-'),x=-x;
    if(x>=10)print(x/10);
    putchar(x%10+'0');
}
template<typename T> void print(T x,char ch){
    print(x),putchar(ch);
}

vector<int> adj[555];

int len;
int a,b,c;
pii dot[555];

bool vis[555];
int ans,ansc;
void dfs(int u,int ch){
    if(u==len+1){
        if(ch>ans){
            ans=ch,ansc=1;
        }else if(ch==ans){
            ansc++;
        }
        return ;
    }
    if(vis[u])dfs(u+1,ch);
    else{
        dfs(u+1,ch);
        vis[u]=1;
        for(auto v:adj[u])vis[v]=1;
        dfs(u+1,ch+1);
        vis[u]=0;
    }
}

void solve(){
    a=read(),b=read(),c=read();
    ans=-1,ansc=0;
    len=0;
    rep(x,-10,10){
        rep(y,-10,10){
            if(x>=-2*a+1&&x<=2*a-1)
                if(y>=-2*b+1&&y<=2*b-1)
                    if(x+y>=-2*c+1&&x+y<=2*c-1){
                        dot[++len]={x,y};
                    }
        }
    }
    rep(i,1,len)adj[i].clear();
    rep(i,1,len)vis[i]=0;
    rep(i,1,len){
        rep(j,i+1,len){
            if(abs(dot[i].fir-dot[j].fir)<=1&&abs(dot[i].sec-dot[j].sec)<=1){
                adj[i].pb(j),adj[j].pb(i);
            }
        }
    }
    // cerr<<"len="<<len<<'\n';
    dfs(1,0);
    printf("%d %d\n",ans,ansc);
}

int main(){
    freopen("geometry.in","r",stdin);
    freopen("geometry.out","w",stdout);
    int T=read();
    while(T--)solve();
    return 0;
}