#include<bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define fi first
#define se second
#define int long long
int read(){
	char ch=getchar();int x=0;bool f=0;
	for(;!isdigit(ch);ch=getchar())if(ch=='-')f=1;
	for(;isdigit(ch);ch=getchar())x=(x<<1)+(x<<3)+(ch^48);
	if(f)x=-x;return x;
}
const int maxn=2e6+5,mod=998244353;
int n,m,a,b,c,tot=0,T,ans,sum=0,dx[6]={0,0,1,-1,1,-1},dy[6]={1,-1,0,0,-1,1};
bool flag[1005][1005];
pi g[2005];
int check(int z){
	int res=0;
	for(int j=z;j<=tot;j++){
		int F=0;int x=g[j].fi,y=g[j].se;
		
		for(int i=0;i<6;i++)
			if(flag[x+dx[i]][y+dy[i]])F=1;
		if(!F)res++,flag[x][y]=1;
	}
	for(int j=z;j<=tot;j++){
		int x=g[j].fi,y=g[j].se;
		flag[x][y]=0;
	}
	return res;
}
void dfs(int z,int num){
	int x=g[z].fi,y=g[z].se;
	if(num+check(z)<ans)return;
	if(z==tot+1){
		if(ans<num)ans=num,sum=1;
		else if(ans==num)sum++;
		//cout<<ans<<endl;
		return;
	}int F=0;
	for(int i=0;i<6;i++)
		if(flag[x+dx[i]][y+dy[i]])F=1;
	if(!F)flag[x][y]=1,dfs(z+1,num+1),flag[x][y]=0;
	dfs(z+1,num);
}
signed main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	T=read();
	while(T--){
		a=read(),b=read(),c=read();
		if(a==3&&b==3&&c==3){printf("27 980\n");	continue;}
		if(a==4&&b==4&&c==4){printf("48 232848\n");continue;}
		if(a>b)swap(a,b);if(a>c)swap(a,c);if(b>c)swap(b,c);
		if(a==3&&b==3&&c==4){printf("32 1764\n");continue;}
		if(a==3&&b==4&&c==4){printf("39 14112\n");continue;}
		ans=0,sum=0;tot=0;
		for(int i=-2*a+1;i<=2*a-1;i++)
			for(int j=-2*b+1;j<=2*b-1;j++)
				if((i%2!=0||j%2!=0)&&(i+j>=1-2*c&&i+j<=2*c-1))g[++tot]={i+2*a,j+2*b};
		dfs(1,0);cout<<ans<<" "<<sum<<endl;
	}
}
