#include<bits/stdc++.h>
using namespace std;

constexpr int mod=998244353;

struct node
{
	int v,c;
}dp[410][1<<15];

node merge(const node &a,const node &b)
{
	if(a.v>b.v) return a;
	else if(a.v<b.v) return b;
	else return {a.v,(a.c+b.c)%mod};
}

int main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	int T;
	scanf("%d",&T);
	dp[0][0]={0,1};
	for(int i=1;i<(1<<15);i++) dp[0][i]={-1000000000,0};
	while(T--)
	{
		int a,b,c,i,j,k;
		cin>>a>>b>>c;
		int n=4*a-1;
		for(i=-b*2+1;i<=b*2-1;i++)
		{
			auto now=dp[i+b*2],pre=dp[i+b*2-1];
			for(j=0;j<(1<<n);j++)
			{
				now[j]=dp[0][1];
				if((j&j<<1)|(j&j>>1)) continue;
				for(k=0;k<n;k++) if((j>>k&1)&&(k-a*2+1+i<-2*c+1||k-a*2+1+i>2*c-1||(i%2==0&&k%2==1))) break;
				if(k<n) continue;
				for(k=0;k<(1<<n);k++)
				{
					if((j&k)|(j&k>>1)) continue;
					now[j]=merge(now[j],pre[k]);
				}
				for(k=0;k<n;k++) now[j].v+=(j>>k&1);
			}
		}
		node ans=dp[0][1];
		for(i=0;i<(1<<n);i++) ans=merge(ans,dp[b*4-1][i]);
		printf("%d %d\n",ans.v,ans.c);
	}
	return 0;
}
