#include<bits/stdc++.h>
using namespace std;
bool m[1210][1210];
long long T,a,b,c,ans1,ans2;
const long long MOD=998244353;
void dfs(int x,int y,int sum)
{
	if (x==4*a) 
	{
		if (sum==ans1) ans2=(ans2+1)%MOD;
		else if (sum>ans1) ans1=sum,ans2=1;
	}
	else if (y==4*b) dfs(x+1,1,sum);
	else 
	{
		dfs(x,y+1,sum);
		if (2*a-x+y-2*b>=-2*c+1 && 2*a-x+y-2*b<=2*c-1 && (x%2!=0 || y%2!=0)  && !(m[x][y-1]||m[x-1][y]||m[x-1][y-1]))
		{
			m[x][y]=1;
			dfs(x,y+1,sum+1);
			m[x][y]=0;
		}
	}
}
int main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	scanf("%d",&T);
	while (T--)
	{
		scanf("%lld%lld%lld",&b,&a,&c);
		dfs(1,1,0);
		printf("%lld %lld\n",ans1,ans2);
		ans1=ans2=0;
	}
	return 0;
}
