




#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
typedef long long ll;
typedef std::pair<int,int> pii;
typedef unsigned un;
ll read()
{
	ll x=0;bool f=0;int 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 f?-x:x;
}
int abs(int x){return x>0?x:-x;}

const int mod = 998244353;
struct Mint
{
	int x;
	Mint(){x=0;}
	Mint(ll y)
	{
		if(0<=y&&y<mod)x=y;
		else x=(y%mod+mod)%mod;
	}
	void operator+= (Mint you){x+=you.x;if(x>=mod)x-=mod;}
	void operator-= (Mint you){x-=you.x;if(x<0)x+=mod;}
	void operator*= (Mint you){x=ll(x)*you.x%mod;}
};
Mint operator+ (Mint a,Mint b){int t=a.x+b.x;return t>=mod?t-mod:t;}
Mint operator- (Mint a,Mint b){int t=a.x-b.x;return t<0?t+mod:t;}
Mint operator* (Mint a,Mint b){return ll(a.x)*b.x%mod;}

const int MAXN = 55;
typedef std::pair<int,Mint> pv;
pv f[1<<15],pre[1<<15];
pv operator+ (pv a,pv b)
{
	if(a.first>b.first)return a;
	else if(a.first<b.first)return b;
	else return pv(a.first,a.second+b.second);
}
void operator+= (pv& a,pv b)
{
	if(b.first>a.first)a=b;
	else if(b.first==a.first)a.second+=b.second;
}
std::vector<int>trans[1<<15],seq;
int cnt[1<<15];
void init(int n)
{
	for(int s=1;s<(1<<n);++s)cnt[s]=cnt[s&(s-1)]+1;
}
int main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	init(15);
	int task=read();
	while(task--)
	{
		int A=2*read()-1,B=2*read()-1,C=2*read()-1;
		int m=2*A+1;
		seq.clear();
		for(int s=0;s<(1<<m);++s)
		{
			if(s&(s>>1))continue;
			seq.emplace_back(s);
		}
	//	double st=clock();
		int L=seq.size();
		for(int i=0;i<L;++i)
		{
			trans[i].clear();
			int s=seq[i];
			int t=(1<<m)-1;
			t^=(s&t),t^=(s<<1)&t;
			for(int j=0;j<L;++j)
				if((seq[j]|t)==t)trans[i].emplace_back(j);
		}
		//fprintf(stderr,"preworkCost:%.4lf\n",double(clock()-st)/CLOCKS_PER_SEC);
		for(int i=1;i<L;++i)f[i]=pv(0,0);
		f[0]=pv(0,1);
		for(int y=-B;y<=B;++y)
		{
			for(int i=0;i<L;++i)pre[i]=f[i],f[i]=pv(0,0);
			int now=0;
			for(int x=-A;x<=A;++x)
				if(((y&1)||(x&1))&&(-C<=x+y&&x+y<=C))now|=1<<(x+A);
			for(int i=0;i<L;++i)
				if((seq[i]&now)==seq[i])
				{
					int s=seq[i];
					int t=(1<<m)-1;
					t^=(s&t),t^=(s<<1)&t;
					for(auto j:trans[i])f[i]+=pre[j];
					f[i].first+=cnt[s];
				}
		}
		pv res(0,0);
		for(int i=0;i<L;++i)res+=f[i];
		printf("%d %d\n",res.first,res.second.x);
	}
	return 0;
}
