#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mu=998244353;
void reduce(int &x){
	x+=x>>31&mu;
}
int a,b,c,T,v[1<<15],st,cc[1<<15];
int f[2][1<<15],g[2][1<<15];
int lowbit(int x){
	return x&(-x);
}
int flip(int x,int y){
	int ret=0;
	for (int i=0;i<y;i++)
		if ((x>>i)&1)
			ret+=1<<(y-i-1);
	return ret;
}
void solve(){
	int n=4*a-1;
	for (int i=1;i<1<<n;i++)
		v[i]=v[i^lowbit(i)]+1;
	int now=0;
	memset(f,-1,sizeof(-1));
	memset(g,0,sizeof(g));
	f[now][0]=0;
	g[now][0]=1;
	int lim=0;
	for (int i=2*b-1;i>=0;i--){
		now=now^1;
		memset(f[now],-1,sizeof(f[now]));
		memset(g[now],0,sizeof(g[now]));
		lim=std::min(4*a-1,2*c-1-i-(1-2*a)+1);
		for (int j=0;j<1<<lim;j++){
			int t=f[now^1][j],tt=g[now^1][j];
			if (!tt) continue;
			int all=(1<<lim)-1;
			if (i%2==0) all&=st;
			all&=((1<<lim)-1)^(j|(j<<1));
			for (int k=all;k>=0;k=(k-1)&all){
				if (!cc[k]) continue;
				if (t+v[k]>f[now][k]){
					f[now][k]=t+v[k];
					g[now][k]=tt;
				}else if (t+v[k]==f[now][k])
					reduce(g[now][k]+=tt-mu);
				if (k==0) break;
			}
		}
	}
	int Ans=0,sum=0;
	for (int i=0;i<1<<lim;i++){
		int fi=flip(i,lim),fans=f[now][i]+f[now][fi]-v[i],gans=(ll)g[now][i]*g[now][fi]%mu;
		if (fans>Ans){
			Ans=fans,sum=gans;
		}else if (fans==Ans) reduce(sum+=gans-mu);
	}
	printf("%d %d\n",Ans,sum);
}
bool chk(int x){
	for (int i=0;i<=14;i++)
		if (((x>>i)&1) && ((x>>(i+1))&1)) return 0;
	return 1;
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	scanf("%d",&T);
	st=0;
	for (int i=0;i<=15;i+=2)
		st|=(1<<i);
	for (int i=0;i<1<<15;i++)
		cc[i]=chk(i);
	while (T--){
		scanf("%d%d%d",&a,&b,&c);
		if (a<=4) solve();
	}
}
