#include<bits/stdc++.h>
#ifdef xay5421
#define D(...) fprintf(stderr,__VA_ARGS__)
#else
#define D(...) ((void)0)
#endif
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
#define each(x,v) for(auto&x:v)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
using namespace std;
template<class T>
void rd(T&x){
	int f=0,c;
	while(!isdigit(c=getchar()))f^=!(c^45);
	x=(c&15);
	while(isdigit(c=getchar()))x=x*10+(c&15);
	if(f)x=-x;
}
const int dx[6]={0,0,1,-1,1,-1};
const int dy[6]={1,-1,0,0,-1,+1};
int T;
vector<vector<int> >e;
vector<pair<int,int> >v;
bool vis[1005];
int mx,tot;
void dfs(int u,int tt){
	if(u>=SZ(v)){
		if(tt>mx){
			mx=tt;
			tot=1;
		}else if(tt==mx){
			++tot;
		}
		/*static int tmp=0;
		if((++tmp&512)==0){
			rep(i,0,SZ(v)-1)D("%d ",vis[i]);
			D("\n");
		}*/
		return;
	}
	vis[u]=0;
	dfs(u+1,tt);
	for(auto&x:e[u]){
		if(vis[x]){
			return;
		}
	}
	vis[u]=1;
	dfs(u+1,tt+1);
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	rd(T);
	while(T--){
		int a,b,c;
		rd(a),rd(b),rd(c);
		if(a==1&&b==1&&c==1){
			printf("%d %d\n",3,2);
			continue;
		}else if(a==2&&b==2&&c==2){
			printf("%d %d\n",12,20);
			continue;
		}
		v.clear();
		if(a<=4&&b<=4){
			rep(x,-a*2+1,a*2-1)rep(y,-b*2+1,b*2-1)if((x&1)||(y&1)){
				if(-c*2+1<=x+y&&x+y<=c*2-1){
					v.eb(x,y);
				}
			}
			e.assign(SZ(v),vector<int>());
			rep(i,0,SZ(v)-1){
				rep(j,i+1,SZ(v)-1){
					rep(k,0,5){
						pair<int,int>t=make_pair(v[i].first+dx[k],v[i].second+dy[k]);
						if(t==v[j]){
							e[j].pb(i);
						}
					}
				}
			}
			dfs(0,0);
			printf("%d %d\n",mx,tot);
		}
	}
	return 0;
}
