/*
after dusk passed,
there is a starry sky.
*/
#include <bits/stdc++.h>
#define m_k make_pair
#define inf 0x3f3f3f3f
#define mod 998244353
#define int long long
#define len(a) (int)a.size()
using namespace std;
const int N=1e5+100;
int T,a,b,c;
vector <pair<int,int> > p[N];
inline void add(int &a,int b){a=((a+b>=mod)?a+b-mod:a+b);}
inline void del(int &a,int b){a=((a-b<0)?a-b+mod:a-b);}
inline void mul(int &a,int b){a=a*b%mod;}
inline int m_pow(int a,int b)
{
	int ans=1;
	while (b)
	{
		if (b&1) mul(ans,a);
		b>>=1;
		mul(a,a);
	}
	return ans;
}
inline int read()
{
	int f=1,x=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
struct node
{
	int MAX,cnt;
};
void merge(node &a,node b)
{
	if (b.MAX>a.MAX) a=b;
	else if (b.MAX==a.MAX) add(a.cnt,b.cnt);
}
node dp[(1<<16)+100],f[(1<<16)+100];
bool check(int x,int y)
{
	return -2*a+1<=x&&x<=2*a-1&&-2*b+1<=y&&y<=2*b-1&&-2*c+1<=x+y&&x+y<=2*c-1&&((x&1)||(y&1));
}
signed main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	T=read();
	while (T--)
	{
		a=read();b=read();c=read();
		int lim=4*a-1,full=(1<<lim)-1,w=0,l=-2*c+1,r=2*c-1;
		for (int j=2*b-1+2*a-1;j>=-2*b+1-2*a+1;j--)
		{
			int x=0,y=j;
			p[++w].clear();
			for (int k=0;k<=2*a-1;k++)
			{
				int tx=x-k,ty=y+k;
				p[w].emplace_back(tx,ty);
				if (k)
				{
					tx=x+k,ty=y-k;
					p[w].emplace_back(tx,ty);
				}
			}
			sort(p[w].begin(),p[w].end());
		}
		for (int mask=0;mask<=full;mask++) dp[mask]=(node){-inf,0};
		dp[0]=(node){0,1};
		for (int i=1;i<=w;i++)
		{
			for (auto [x,y]:p[i])
			{
				int id=x-(1-2*a);
				for (int mask=0;mask<=full;mask++) f[mask]=(node){-inf,0};
				for (int mask=0;mask<=full;mask++) if (dp[mask].MAX!=-inf)
				{
					bool ok=check(x,y);
					if (mask>>id&1) ok=0;
					else if (id>0&&(mask>>(id-1)&1)) ok=0;
					else if (id+1<lim&&(mask>>(id+1)&1)) ok=0;
					if (ok)
					{
						dp[mask].MAX++;
						merge(f[mask|(1<<id)],dp[mask]);
						dp[mask].MAX--;
					}
					int s=mask;
					if (s>>id&1) s^=(1<<id);
					merge(f[s],dp[mask]);
				}
				memcpy(dp,f,(full+10)*sizeof(node));
			}
		}
		int MAX=0;
		for (int mask=0;mask<=full;mask++) MAX=max(MAX,dp[mask].MAX);
		int ans=0;
		for (int mask=0;mask<=full;mask++) if (dp[mask].MAX==MAX) add(ans,dp[mask].cnt);
		printf("%lld %lld\n",MAX,ans);
	}
}