#include<bits/stdc++.h>
template<typename _Tp>void read(_Tp &x){
	char ch=getchar();bool f=0;while(!isdigit(ch))f|=ch=='-',ch=getchar();
	x=ch&15,ch=getchar();while(isdigit(ch))x=x*10+(ch&15),ch=getchar();
	if(f)x=-x;
}
template<typename _Tp,typename ...Args>void read(_Tp &x,Args &...args){read(x),read(args...);}
const int mod=998244353;typedef std::pair<int,int> pi;
template<typename _Tp1,typename _Tp2>inline void add(_Tp1 &a,_Tp2 b){a=a+b>=mod?a+b-mod:a+b;}
template<typename _Tp1,typename _Tp2>inline void sub(_Tp1 &a,_Tp2 b){a=a<b?a+mod-b:a-b;}
const int dx[]={0,0,1,-1,1,-1},dy[]={1,-1,0,0,-1,1};
struct node{
	int val,cnt;
	inline void operator += (const node &o){
		if(o.val>val)*this=o;
		else if(o.val==val)add(cnt,o.cnt);
	}
};
int vec[20],nv[20];int dg[300005];bool ban[1<<15];pi nd[300005];
node f[1<<15],g[1<<15];int h[1<<15];
int la,lb,lc,ra,rb,rc,nid[15];
inline bool check(int x,int y){return la<=x&&x<=ra&&lb<=y&&y<=rb&&lc<=x+y&&x+y<=rc&&(x%2||y%2);}
bool adj(const pi &a,const pi &b){
	for(int dir=0;dir<6;++dir){
		int x=a.first+dx[dir],y=a.second+dy[dir];
		if(x==b.first&&y==b.second)return 1;
	}
	return 0;
}
void MAIN(){
	int a,b,c;read(a,b,c);
	la=-2*a+1,ra=2*a-1,lb=-2*b+1,rb=2*b-1,lc=-2*c+1,rc=2*c-1;int n=0;
	for(int y=lb;y<=rb;++y){
		for(int x=la;x<=ra;++x)if(check(x,y)){
			nd[++n]={x,y};
			for(int dir=0;dir<6;++dir){
				int u=x+dx[dir],v=y+dy[dir];
				if(check(u,v))++dg[n];
			}
		}
	}
	int pos=0,id=0;f[0]={0,1};
	for(int y=lb;y<=rb;++y){
		for(int x=la;x<=ra;++x)if(check(x,y)){
			++id,memset(ban,0,1<<pos);
			for(int st=0;st<1<<(pos+1);++st)g[st]={-1,0};
			for(int i=0;i<pos;++i)if(adj(nd[vec[i]],{x,y}))ban[1<<i]=1,--dg[id],--dg[vec[i]];
			for(int st=0;st<1<<pos;++st){
				ban[st]=ban[st&(-st)]||ban[st&(st-1)];
				if(f[st].val>=0){
					g[st]+=f[st];node tmp=f[st];++tmp.val;
					if(!ban[st])g[st|1<<pos]+=tmp;
				}
			}
			vec[pos++]=id;int cur=0;
			memset(h,0,4<<pos);
			for(int i=0;i<pos;++i){
				if(!dg[vec[i]])nid[i]=-1;
				else nid[i]=cur,h[1<<i]=1<<cur,++cur;
			}
			for(int i=0;i<1<<cur;++i)f[i]={-1,0};
			for(int st=0;st<1<<pos;++st){
				h[st]=h[st&(-st)]|h[st&(st-1)];
				f[h[st]]+=g[st];
			}
			int np=0;for(int i=0;i<pos;++i)if(dg[vec[i]])nv[np++]=vec[i];
			pos=np,memcpy(vec,nv,pos<<2);
		}
	}
//	assert(pos==0);
	printf("%d %d\n",f[0].val,f[0].cnt);
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	int _;read(_);
	while(_--)MAIN();
	return 0;
}
