#include <bits/stdc++.h>
using namespace std;
#define pb push_back
const int mod=998244353;
const int Inf=1e9;
vector<int> vec,trans[1000005];
int f[2][3000005],g[2][3000005];
int a,b,c;
int main() {
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	int T; cin>>T;
	while (T--) {
		//double tim=clock();
		scanf("%d%d%d",&a,&b,&c);
		vec.clear();
		int lim=4*a-1,op=0;
		for (int sta=0; sta<(1<<lim); sta++) {
			bool flag=1;
			for (int i=2; i<=lim; i++)
				if ((sta&(1<<(i-1))) && (sta&(1<<(i-2)))) flag=0;
			if (flag) vec.pb(sta);
		}
		for (int sta: vec) {
			trans[sta].clear();
			for (int sta2 : vec)
				if ((sta&sta2)==0 && (sta&(sta2>>1))==0)
					trans[sta].pb(sta2);
		}
		//for (int pp: vec) cout<<pp<<' '; cout<<endl;
		
		for (int sta=0; sta<(1<<lim); sta++) f[op][sta]=-Inf;
		f[op][0]=0; g[op][0]=1;
		
		for (int y=-(2*b-1); y<=(2*b-1); y++) {
			for (int sta: vec) f[op^1][sta]=-Inf,g[op^1][sta]=0;
			for (int sta: vec) {
				int flag=1,num=0;
				for (int i=1; i<=lim; i++) {
					int x=i-2*a;
					if (x%2==0 && y%2==0 && (sta&(1<<(i-1)))) { flag=0; break; }
					if (!(-(2*c-1)<=x+y && x+y<=2*c-1) && (sta&(1<<(i-1)))) { flag=0; break; }
					if (sta&(1<<(i-1))) num++;
				}
				if (flag==0) continue;
				//if (y==-2*b+1) cerr<<"!!!!!!!!!!!"<<sta<<' '<<y<<' '<<endl;
				for (int sta2: trans[sta]) 
					if (f[op][sta2]!=-Inf) {
						//cerr<<num<<' '<<sta2<<' '<<sta<<' '<<f[op][sta2]<<endl;
						if (num+f[op][sta2]>f[op^1][sta]) f[op^1][sta]=num+f[op][sta2],g[op^1][sta]=g[op][sta2];
						else if (num+f[op][sta2]==f[op^1][sta]) g[op^1][sta]=(g[op^1][sta]+g[op][sta2])%mod;
					}
			}
			op^=1;
		}
		int ans=-Inf,val=0;
		for (int sta : vec)
			if (f[op][sta]>ans) ans=f[op][sta],val=g[op][sta];
			else if (f[op][sta]==ans) val=(val+g[op][sta])%mod;
		printf("%d %d\n",ans,val); 
	}
	return 0;
}
