#include <bits/stdc++.h>
using namespace std;
int read(){
	int x=0,f=1;char c=getchar();
	while (c<'0' || c>'9'){
		if (c=='-') f=-f;c=getchar();
	}
	while (c>='0' && c<='9'){
		x=x*10+c-48;c=getchar();
	}
	return x*f;
}
struct pt{
	int x,y;
	pt(int _x=0,int _y=0){
		x=_x;y=_y;
	}
};
vector <pt> v;
int vis[1010][1010];
void getvis(int x,int y,int tp){
	x+=100;y+=100;
	vis[x][y+1]+=tp;vis[x][y-1]+=tp;vis[x+1][y]+=tp;vis[x-1][y]+=tp;vis[x+1][y-1]+=tp;vis[x-1][y+1]+=tp;
}
int findvis(int x,int y){
	x+=100;y+=100;
	return vis[x][y];
}
int ans,maxx,maxc;
void dfs(int t,int y){
	if (t>=(int)v.size()){
		if (y>maxx) maxx=y,maxc=1;
		else if (y==maxx) maxc++;
	}else{
		if (!findvis(v[t].x,v[t].y)){
			getvis(v[t].x,v[t].y,1);
			dfs(t+1,y+1);
			getvis(v[t].x,v[t].y,-1);
			dfs(t+1,y);
		}else dfs(t+1,y);
	}
}
signed main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	int T=read();
	while (T --> 0){
		memset(vis,0,sizeof(vis));
		v.clear();
		int a=read(),b=read(),c=read();
		for (int x=-2*a+1;x<=2*a-1;++x){
			for (int y=-2*b+1;y<=2*b-1;++y){
				if (x+y>=-2*c+1 && x+y<=2*c-1 && (abs(x)%2==1 || abs(y)%2==1)){
					v.push_back(pt(x,y));
				}
			}
		}
		dfs(0,0);
		cout<<maxx<<" "<<maxc<<endl;
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}