#include<bits/stdc++.h>

using namespace std;

const int N=666;

int mx, cnt[N];

int T, a, b, c;

vector<pair<int, int> > vec;
map<pair<int, int>, bool> mark;

int f[6][2]={0,1,0,-1,1,0,-1,0,1,-1,-1,1};

void dfs(int pos, int tot)
{
	if(pos==vec.size())
	{
		mx=max(mx, tot);
		cnt[tot]++;
		return;
	}
	dfs(pos+1, tot);
	for(int i=0; i<6; i++) if(mark[make_pair(vec[pos].first+f[i][0], vec[pos].second+f[i][1])]) return;
	mark[vec[pos]]=true;
	dfs(pos+1, tot+1);
	mark[vec[pos]]=false;
	return;
}

int main()
{
	freopen("geometry.in", "r", stdin);
	freopen("geometry.out", "w", stdout);
	
	scanf("%d", &T);
	for( ; T>0; --T)
	{
		mx=0; memset(cnt, 0, sizeof cnt);
		vec.clear();
		mark.clear();
		scanf("%d%d%d", &a, &b, &c);
		for(int x=-2*a+1; x<=2*a-1; x++)
		{
			for(int y=-2*b+1; y<=2*b-1; y++)
			{
				if(-2*c+1<=x+y&&x+y<=2*c-1&&((x&1)||(y&1))) vec.push_back(make_pair(x, y));
			}
		}
		
		dfs(0, 0);
		
		printf("%d %d\n", mx, cnt[mx]);
	}
	
	return 0;
}
