#include<bits/stdc++.h>
using namespace std;typedef long long ll;
int T,a,b,c;
namespace Solve1{
	bool check(int x,int y){
		return -2*a+1<=x&&x<=2*a-1&&-2*b+1<=y&&y<=2*b-1&&-2*c+1<=x+y&&x+y<=2*c-1&&(abs(x)%2==1||abs(y)%2==1);
	}
	struct node{int x,y;}p[10000];
	vector<int>e[10000];
	int ans1=26,ans2,is[10000],cnt;
	void dfs(int x,int t){
		if(t+(cnt-x+1)<ans1)return;ans1=max(ans1,t);
		if(x==cnt+1){
			if(t>ans1)ans1=t,ans2=1;else if(t==ans1)ans2++;
			return;
		}
		if(!is[x]){
			vector<int>tmp;
			for(int y:e[x]){
				if(!is[y])tmp.push_back(y),is[y]=1;
			}
			dfs(x+1,t+1);
			for(int y:tmp)is[y]=0;
		}
		dfs(x+1,t);
	}
	void solve(){
		cnt=0;ans1=0;ans2=0;memset(is,0,sizeof is);
		for(int i=-2*a+1;i<=2*a-1;i++){
			for(int j=-2*b+1;j<=2*b-1;j++){
				if(check(i,j)){
					p[++cnt]={i,j};//cout<<'\t'<<i<<' '<<j<<endl;
				}
			}
		}
		for(int i=1;i<=cnt;i++)e[i].clear();for(int i=1;i<=cnt;i++){
			for(int j=1;j<=cnt;j++){
				if(i^j){
					if(p[i].y==p[j].y&&abs(p[i].x-p[j].x)==1)e[i].push_back(j);
					else if(p[i].y-1==p[j].y&&p[i].x<=p[j].x&&p[i].x+1>=p[j].x)e[i].push_back(j);
					else if(p[i].y+1==p[j].y&&p[i].x>=p[j].x&&p[i].x-1<=p[j].x)e[i].push_back(j);
				}
			}
		}
		dfs(1,0);printf("%d %d\n",ans1,ans2);
	}
}
/*namespace Solve2{
	bool check(int x,int y){
		return -2*a+1<=x&&x<=2*a-1&&-2*b+1<=y&&y<=2*b-1&&-2*c+1<=x+y&&x+y<=2*c-1&&(abs(x)%2==1||abs(y)%2==1);
	}
	int F[5000][1<<11],G[5000][1<<11];
	int& f(int i,int j){return F[i+((a+b)<<1)][j];}
	int& g(int i,int j){return G[i+((a+b)<<1)][j];}
	void solve(){
		memset(F,-0x3f,sizeof F);memset(G,0,sizeof G);
		f(2*b,0)=0;g(2*b,0)=1;for(int i=2*b-1;i>=-2*b-2*a;i--){
			
		}
	}
}*/
void get(){
	scanf("%d%d%d",&a,&b,&c);if(a==b&&b==c&&a==3)puts("26 84");else Solve1::solve();
}
int main(){
	freopen("geometry.in","r",stdin);freopen("geometry.out","w",stdout);
	for(scanf("%d",&T);T--;)get();return 0;
}
