#include<bits/stdc++.h>
using namespace std;
const int MAXN = 55;
bool vis[MAXN][MAXN];
int cnt,Ans,a,b,c;
void dfs(int x,int y,int w)
{
	if(x==4*a)
	{
		if(w>cnt)
		{
			cnt=w;
			Ans=0;
		}
		if(cnt==w) ++Ans;
		return ;
	}
	if(y==4*b)
	{
		dfs(x+1,1,w);
		return ;
	}
	if(x+y<=2*a+2*b+2*c-1&&x+y>=2*a+2*b-2*c+1)
	{
		if(x%2!=0||y%2!=0)
		{
			if(!vis[x][y-1]&&!vis[x-1][y]&&!vis[x-1][y+1])
			{
				vis[x][y]=1;
				dfs(x,y+1,w+1);
			}				
		}
	}
	
	vis[x][y]=0;
	dfs(x,y+1,w);
}
int main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	int T;scanf("%d",&T);
	while(T--)
	{
		memset(vis,0,sizeof vis);
		cnt=0;Ans=0;
		scanf("%d %d %d",&a,&b,&c);
		dfs(1,1,0);
		printf("%d %d\n",cnt,Ans);
	}
	return 0;
}
