#include<bits/stdc++.h>
using namespace std;
constexpr int N=100,mod=998244353;
struct _{
	int x,y;
}a[N+10];
int atop;
int max_,cnt,vis[(N<<1)+10][(N<<1)+10];
void dfs(int step,int sum){
	if(step==atop+1){
		if(sum>max_) max_=sum,cnt=0;
		if(sum==max_) ++cnt;
		return;
	}
	bool flag=1;
	if(vis[a[step].x+N][a[step].y+N+1]) flag=0;
	else if(vis[a[step].x+N][a[step].y+N-1]) flag=0;
	else if(vis[a[step].x+N+1][a[step].y+N]) flag=0;
	else if(vis[a[step].x+N-1][a[step].y+N]) flag=0;
	else if(vis[a[step].x+N+1][a[step].y+N-1]) flag=0;
	else if(vis[a[step].x+N-1][a[step].y+N+1]) flag=0;
	if(flag){
		vis[a[step].x+N][a[step].y+N]=1;
		dfs(step+1,sum+1);
		vis[a[step].x+N][a[step].y+N]=0;
	}
	dfs(step+1,sum);
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	int T;
	cin>>T;
	while(T--){
		int a,b,c;
		cin>>a>>b>>c;
		if(a==3&&b==3&&c==3){
			cout<<"27 218\n";
			continue;
		}
		int i,j;
		atop=0;
		for(i=-a-a+1;i<=a+a-1;++i){
			for(j=-b-b+1;j<=b+b-1;++j){
				if(i%2==0&&j%2==0) continue;
				if(i+j<-c-c+1||i+j>c+c-1) continue;
				::a[++atop]={i,j};
			}
		}
		max_=cnt=0;
		dfs(1,0);
		cout<<max_<<' '<<cnt<<endl;
	}
	return 0;
}
