#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
inline int read()
{
	char c=getchar();int x=0,f=0;
	for(;!isdigit(c);c=getchar())if(c=='-')f=1;
	for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
	if(f)x=-x;return x;
}

#define mod 998244353
struct modint{
	int x;
	modint(int o=0){x=o;}
	modint&operator =(int o){return x=o,*this;}
	modint&operator +=(modint o){return x=x+o.x>=mod?x+o.x-mod:x+o.x,*this;}
	modint&operator -=(modint o){return x=x-o.x<0?x-o.x+mod:x-o.x,*this;}
	modint&operator *=(modint o){return x=1ll*x*o.x%mod,*this;}
	modint&operator ^=(int b){
		modint a=*this,c=1;
		for(;b;b>>=1,a*=a)if(b&1)c*=a;
		return x=c.x,*this;
	}
	modint&operator /=(modint o){return *this*=(o^=(mod-2));}
	friend modint operator +(modint a,modint b){return a+=b;}
	friend modint operator -(modint a,modint b){return a-=b;}
	friend modint operator *(modint a,modint b){return a*=b;}
	friend modint operator /(modint a,modint b){return a/=b;}
	modint operator -(){return x?mod-x:0;}
};

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 200005
#define inf 0x3f3f3f3f

struct node{
	int x; modint y;
};
node operator +(node a,node b){
	if(a.x!=b.x)return a.x>b.x?a:b;
	return (node){a.x,a.y+b.y};
}

int n,mxs,a,b,c,popcnt[1<<15];
node f[1<<15],g[1<<15];
int st[maxn],len;

void work()
{
	a=read(),b=read(),c=read(); n=0;
	For(x,-2*a+1,2*a-1)++n; mxs=(1<<n);
	For(i,0,mxs-1) f[i]=g[i]=(node){-inf,0};
	f[1]=(node){0,1};
	len=0;
	For(i,0,mxs-1) if(!(i&(i>>1))) st[++len]=i;
	For(y,-2*b+1,2*b-1){
		int qwq=0,sta=0;
		For(x,-2*a+1,2*a-1){
			if((x%2||y%2) && x+y<=2*c-1 && x+y>=-2*c+1) 
				sta|=(1<<qwq);
			++qwq;
		}
	//	cout<<"sta "<<y<<' '<<sta<<endl;
		For(i,1,len){
			int s=st[i];
			if(f[i].x<0)continue;
			For(j,1,len)
				if((st[j]&sta)==st[j] && (!(st[j]&s)) && (!(st[j]&(s>>1))))
					g[j]=g[j]+f[i];
		}
		For(i,1,len){
			f[i]=g[i],g[i]=(node){-inf,0};
			f[i].x+=popcnt[st[i]];
		}
	}
	node res=(node){-inf,0};
	For(i,1,len) res=res+f[i];
	cout<<res.x<<' '<<res.y.x<<endl;
}

signed main()
{
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	For(i,1,(1<<15)-1) popcnt[i]=popcnt[i>>1]+(i&1);
	int T=read();
	while(T--)work();
	return 0;
}
/*
10
3 4999 4999
*/ 
