#include<bits/stdc++.h>
#define For(i,j,k) for(int i=(j);i<=(k);i++)
#define foR(i,j,k) for(int i=(j);i>=(k);i--)
#define vi vector<int>
#define mst(a,b) memset(a,b,sizeof(a))
#define SZ(x) ((int)x.size())
using namespace std;
#define INF ((1<<30)-1)
//#define int long long
int read() { int x; scanf("%d",&x); return x; }
const int P=998244353;
int add(int x,int y) { return (x+y)%P; }
int sub(int x,int y) { return (x-y+P)%P; }
int mul(int x,int y) { return 1ull*x*y%P; }
void mulmod(int &x,int y) {x=mul(x,y); }
void submod(int &x,int y) {x=sub(x,y); }
void addmod(int &x,int y) {x=add(x,y); }
int ksm(int x,int y) { int ans=1; for(;y;y>>=1) { if(y&1) ans=mul(ans,x); x=mul(x,x); } return ans; }
int inv(int x) { return ksm(x,P-2); }
void fprint(int *a,int n) { For(i,1,n) fprintf(stderr,"%d ",a[i]); fprintf(stderr,"\n"); }
const int MN=1e5+5;

int f[1<<16|1],g[1<<16|1],cf[1<<16|1],cg[1<<16|1],A,B,C,n,m,ok[MN];
void push() {
	For(i,0,(1<<(n+1))-1) {
//		if(f[i]<0) assert(cf[i]==0);
		g[i]=f[i],cg[i]=cf[i];
		f[i]=-INF,cf[i]=0;
	}
}
void trans(int x,int y,int v) {
	x&=(1<<(n+1))-1,y&=(1<<(n+1))-1;
	if(g[x]+v>f[y]) {
//		cerr<<"?"<<' '<<f[y]<<endl;
		f[y]=g[x]+v,cf[y]=cg[x];
	} else if(g[x]+v==f[y]) {
//		cf[y]=(cf[y]+cg[x])%P;
		addmod(cf[y],cg[x]);
	}
	
}
void works() {
	
	A=read(),B=read(),C=read();
	n=(4*A)-1,m=4*B-1;
//	cerr<<n<<endl;
	For(i,0,(1<<(n+1))-1) {
		g[i]=f[i]=-INF,cg[i]=cf[i]=0;
	}
	g[0]=0,cg[0]=1;
	For(i,0,m-1) {
		
		int y=i-(2*B-1);
		For(j,0,n-1) ok[j]=1;
		For(j,0,n-1) {
			int x=j-(2*A-1);
			if(x+y<-2*C+1||x+y>2*C-1||(abs(y)%2==0&&abs(x)%2==0)) ok[j]=0;
		}
//		fprint(ok,n);
		foR(j,n-1,0) {
			if(!ok[j]) {
				For(st,0,(1<<(n+1))-1) {
					trans(st,st<<1,0);
				}
			} else {
				For(st,0,(1<<(n+1))-1) {
					if(!(st>>n&1)&&!(st>>(n-1)&1)&&!(j!=n-1&&(st&1)) ) {
						trans(st,st<<1|1,1);
					}
					trans(st,st<<1,0);
				}	
			}
			push();
			
//		fprint(g-1,(1<<(n+1))-1);
		}
		For(st,0,(1<<(n+1))-1) {
			trans(st,st&((1<<n)-1),0);
		}
		push();
//		fprint(g-1,(1<<(n+1))-1);
	}
	For(st,0,(1<<(n))-1) {
		trans(st,1,0);	
	}
	printf("%d %d\n",f[1],cf[1]);
}
signed main() {
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	int T=read();
	while(T--) {
		works();
	}
	return 0;
}

