#include <bits/stdc++.h>
using namespace std;
int dp[2][1<<15],f[2][1<<15],a,b,c,T;
const int mod=998244353;
int main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	scanf("%d",&T);
	while(T--)
	{
		memset(dp,0,sizeof(dp));
		memset(f,0,sizeof(f));
		scanf("%d %d %d",&a,&b,&c);
		f[0][0]=1;int S=1,nxt=0;
		for(int i=-2*b+1;i<=2*b-1;i++)
		{
			S^=1,nxt^=1;
			memset(f[nxt],0,sizeof(f[nxt]));
			memset(dp[nxt],0,sizeof(dp[nxt]));
			for(int j=0;j<(1<<(4*a-1));j++)
			{
				bool flag=true;
				for(int k=-2*a+1;k<=2*a+1;k++)
				{
					if(i%2==0&&k%2==0&&((1<<(k+(2*a-1)))&j)){flag=false;break;}
					if(((1<<(k+(2*a-1)))&j)&&((1<<(k+(2*a)))&j))
					{
						flag=false;
						break;
					}
					if(((1<<(k+(2*a-1)))&j)&&(k+i>2*c-1||k+i<-2*c+1))
					{
						flag=false;
						break;
					}
				}
				if(!flag) continue;
				int st=(1<<(4*a-1))-1,cnt=__builtin_popcount(j);
				int now=(j<<1)|j;st^=st&now;
				for(int s=st;;s=(s-1)&st)
				{
					dp[nxt][j]=max(dp[nxt][j],dp[S][s]+cnt);
					if(!s) break;
				}
				for(int s=st;;s=(s-1)&st)
				{
					if(dp[nxt][j]==dp[S][s]+cnt)
						f[nxt][j]=(f[nxt][j]+f[S][s])%mod;
					if(!s) break;
				}
			}
		}
		int ans=0,rans=0;
		for(int i=0;i<(1<<(4*a-2));i++)
			ans=max(ans,dp[nxt][i]);
		for(int i=0;i<(1<<(4*a-2));i++)
			if(ans==dp[nxt][i])
				rans=(rans+f[nxt][i])%mod;
		printf("%d %lld\n",ans,rans);
	}
	return 0;
}
