#include<bits/stdc++.h>
using namespace std;
inline long long read(){
	long long x=0,f=1;char ch=getchar();
	while ((ch!='-')&&(!isdigit(ch))) ch=getchar();
	if (ch=='-') f=-1;
	while (isdigit(ch)) x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
	return x*f;
}
struct node{long long x,y;} F[1001010];
map<pair<long long,long long> ,long long > tag;
bool exist[1001010];
int vis[1001010];
long long fre[1001010],n,len,bel[1001010],cnt,a[1001010],b[1001010],d[1001010],tot,stak[1001010],low[1001010],dfn[1001010],final,sta,i,j,ext[101010],G1,G2,A,B,C,id,now,x,y;
void add(int x,int y){
	cnt++;a[cnt]=y;b[cnt]=d[x];d[x]=cnt;
}
void tarjan(int x){
	dfn[x]=low[x]=++id;stak[++len]=x;exist[x]=true;
	for (int i=d[x];i;i=b[i])
	     if (dfn[a[i]]==0){
	     	tarjan(a[i]);
	     	low[x]=min(low[x],low[a[i]]);
		 }else if (exist[a[i]]==true) low[x]=min(low[x],dfn[a[i]]);
	if (dfn[x]==low[x]){
		tot++;
		while (stak[len]!=x) bel[stak[len]]=tot,exist[stak[len]]=false,len--;
		bel[x]=tot;exist[x]=false;len--;
	}
 }
 bool check(int x){
 	int tx=F[x].x,ty=F[x].y;int now;
    now=tag[make_pair(tx-1,ty)];if ((now>0)&&(vis[now]==1)) return false;
    now=tag[make_pair(tx+1,ty)];if ((now>0)&&(vis[now]==1)) return false;
    now=tag[make_pair(tx,ty-1)];if ((now>0)&&(vis[now]==1)) return false;
    now=tag[make_pair(tx,ty+1)];if ((now>0)&&(vis[now]==1)) return false;
    now=tag[make_pair(tx-1,ty+1)];if ((now>0)&&(vis[now]==1)) return false;
    now=tag[make_pair(tx+1,ty-1)];if ((now>0)&&(vis[now]==1)) return false;
    return true;
 }
 void sc(int x,int y){
 	if (x>n) 
	    {
		fre[y]++;return ;
	    }
 	 G1=max(G1,(long long)y);
 	 if (check(x)){
 	 	  vis[x]=1;sc(x+1,y+1);
 	 	  vis[x]=0;sc(x+1,y);
	  }
	 else {
	 	vis[x]=0;sc(x+1,y);
	 } 
 }
void Main(){
	A=read();B=read();C=read();
	tag.clear();n=0;G1=0;G2=0;
	for (i=-2*A+1;i<=2*A-1;i++)
	    for (j=-2*B+1;j<=2*B-1;j++)
	         if ((i+j>=-2*C+1)&&(i+j<=2*C-1)) 
	               if ((abs(i) % 2!=0)||(abs(j) % 2!=0))
	                     {
	                     	  tag[make_pair(i,j)]=++n;
	                     	  F[n].x=i;F[n].y=j;
					     }
	for (i=1;i<=n;i++) vis[i]=-1,fre[i]=0;
	sc(1,0);
	/*final=(1<<id)-1;
	for (i=1;i<=final;i++) V[i]=false,fre[i]=fre[i^i&-i]+1;
	G1=0;
	for (sta=0;sta<=final;sta++){flag=true;
		for (i=1;i<=id;i++)
		   if ((sta&(1<<(i-1))))
		        if (sta&ext[i])
		           {
		           	flag=false;break;
				   }
		if (flag) V[sta]=true,G1=max(G1,(long long)fre[sta]);
	}
	G2=0;
	for (sta=0;sta<=final;sta++)
	      if ((V[sta])&&(fre[sta]==G1))
	           G2++;
	printf("%lld %lld\n",G1,G2);*/
	printf("%lld %lld\n",G1,fre[G1]);
}
int main(){
	int Testing=read();
	for (;Testing;Testing--) Main();
	return 0;
}

