#include<bits/stdc++.h>
using namespace std;
bool f1;
#define LL long long
#define Max(a,b) ((a)<(b))&&((a)=(b))
#define Min(a,b) ((a)>(b))&&((a)=(b))
int rd() {
	int res=0;char ch;
	bool f=false;
	while(ch=getchar(),ch<48||ch>57)if(ch=='-')f=true;
	do res=(res<<1)+(res<<3)+(ch^48);
	while(ch=getchar(),ch>47&&ch<58);
	return f?-res:res;
}
const int M=1e6;
const int P=998244353;
int T,m,t;
int a,b,c;
void Add(int &x,int y) {x+=y;(x>=P)&&(x-=P);}
namespace P40 {
	int dp[2][65540];
	int Ans[2][65540];
	int Mx;
	bool cur;
	int que[M],R,Sz[M],cnt[M];
	int Q[1000][1000];
	bool Check(int x,int y) {
		int now=0;
		for(int i=0; i<m-1; ++i)
			if(x&(1<<i))now|=1<<i+1;
		x|=now;
		return (x&y)==0;
	}
	bool Judge(int x,int y) {
		for(int i=0; i<m; ++i) {
			if(y&(1<<i)) {
				int j=i-2*a+1;
				if(x+j<-2*c+1||x+j>2*c-1||(x%2==0&&j%2==0))return false;
			}
		}return true;
	}
	int Lx[M],Rx[M],Even[M];
	void Get_max() {
		R=0;cur=0;
		memset(dp,0,sizeof dp);
		memset(Ans,0,sizeof Ans);
		int lb=-2*b+1,rb=2*b-1;
		int la=-2*a+1,ra=2*a-1;
		m=4*a-1,t=1<<m;Mx=0;Ans[0][1]=1;
		for(int i=0; i<t; ++i) {
			bool mk=true;
			for(int j=1; j<m; ++j)
				if((i&(1<<j))&&(i&(1<<j-1))) {mk=false;break;}
			if(mk)que[++R]=i;
		}
		for(int i=1; i<=R; ++i) {
			Sz[i]=cnt[i]=0;Lx[i]=1e9,Rx[i]=-1e9;
			for(int j=0; j<m; ++j)
				if(que[i]&(1<<j)) {
					cnt[i]++,Even[i]|=((-2*a+1+j)%2==0);
					if(Lx[i]>M)Lx[i]=-2*a+1+j;
					Rx[i]=-2*a+1+j;
				}
			for(int j=1; j<=R; ++j)
				if(Check(que[i],que[j]))Q[i][++Sz[i]]=j;
		}
		for(int i=rb; i>=lb; --i) {
			for(int x=1; x<=R; ++x)dp[cur^1][x]=0;
			for(int x=1; x<=R; ++x)
				for(int y=1; y<=Sz[x]; ++y) {
					int now=Q[x][y];
					if(i+Lx[now]<-2*c+1||i+Rx[now]>2*c-1||(i%2==0&&Even[now]))continue;
					if(dp[cur^1][now]<dp[cur][x]+cnt[now])
						dp[cur^1][now]=dp[cur][x]+cnt[now],Ans[cur^1][now]=Ans[cur][x];
					else if(dp[cur^1][now]==dp[cur][x]+cnt[now])
						Add(Ans[cur^1][now],Ans[cur][x]);
				}
			cur^=1;
		}
		int res=0;
		for(int i=1; i<=R; ++i) {
			if(dp[cur][i]>Mx)res=Ans[cur][i],Mx=dp[cur][i];
			else if(dp[cur][i]==Mx)Add(res,Ans[cur][i]);
		}
		printf("%d %d\n",Mx,res);
	}
	void Solve() {
		Get_max();
	}
}
bool f2;
int main() {
//	printf("%lf\n",(&f2-&f1)/1024.0/1024.0);
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	T=rd();
	while(T--) {
		a=rd(),b=rd(),c=rd();	
		if(a<=4)P40::Solve();
	}
	return 0;
}
