#include<bits/stdc++.h>
#define CT cout << "\n-----------------------\n";
using namespace std;
typedef long long ll;
const int inf=1<<30;
const ll Inf=1ll<<60;
//ff0 /se/se/se
const ll mod=998244353;
int a,b,c;
inline void reduce(int&x){
	(x>=mod)&&(x-=mod);
}
struct node{
	int mx,cnt;
	node(){}
	node(int A,int B):mx(A),cnt(B){}
	node operator +(node r)const{
		node res; res.mx=max(mx,r.mx);
		res.cnt=0;
		if(r.mx==res.mx) res.cnt+=r.cnt;
		if(mx==res.mx) reduce(res.cnt+=cnt);
		return res;
	}
};
const int LIM=1<<15;
node f[LIM],g[LIM];
int odd[LIM],even[LIM],tot1,tot2,popc[LIM];
vector<int> v1[LIM],v0[LIM];
inline bool check(int y,int s){
	for(int i=0;i<4*a-1;++i)
		if((s>>i&1)&&((-2*a+1+i)+y<=-2*c||(-2*a+1+i)+y>=2*c)) return 0;
	return 1;
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int T; cin >> T;
	while(T--){
		cin >> a >> b >> c;
		int up=min(2*c-2*a,2*c+2*a-2);
		int down=max(-2*c-2*a+2,-2*c+2*a);
		memset(f,0,sizeof(f));
		f[0]=node(0,1);
		int tot=(1<<(4*a-1))-1;
		//preworks
		tot1=tot2=0;
		for(int s=0;s<=tot;++s){
			if(s&(s>>1)) continue;
			odd[++tot1]=s;
		}
		int ck=0;
		for(int i=1;i<4*a-1;i+=2)
			ck|=(1<<i);
		for(int s=0;s<=tot;++s){
			if(s&(s>>1)) continue;
			if(s&ck) continue;
			even[++tot2]=s;
		}
		
		for(int pre=1;pre<=tot1;++pre){
			v1[pre].clear();
			for(int nxt=1;nxt<=tot2;++nxt){
				if(odd[pre]&even[nxt]) continue;
				if((even[nxt]>>1)&odd[pre]) continue;
				v1[pre].push_back(nxt);
			}
		}
		
		for(int pre=1;pre<=tot2;++pre){
			v0[pre].clear();
			for(int nxt=1;nxt<=tot1;++nxt){
				if(even[pre]&odd[nxt]) continue;
				if((even[pre]<<1)&odd[nxt]) continue;
				v0[pre].push_back(nxt);
			}
		}
		
//		cout << "odd:" << tot1 << '\n';
//		cout << "even:" << tot2 << '\n';
		
		for(int s=0;s<=tot;++s)
			popc[s]=__builtin_popcount(s);
		int qaq=max(-2*b+1,-2*c-2*a+2);
		for(int y=min(2*b-1,2*c+2*a-2);y>=qaq;--y){//curr
			memset(g,0,sizeof(g));
			if(y%2==0){
				for(int pre=1;pre<=tot1;++pre){
					for(int nxt:v1[pre]){
						if((y>up||y<down)&&!check(y,even[nxt])) continue;
						node tr=f[odd[pre]];
						tr.mx+=popc[even[nxt]];
						g[even[nxt]]=g[even[nxt]]+tr;
					}
				}
			}else{
				for(int pre=1;pre<=tot2;++pre){
					for(int nxt:v0[pre]){
						if((y>up||y<down)&&!check(y,odd[nxt])) continue;
						node tr=f[even[pre]];
						tr.mx+=popc[odd[nxt]];
						g[odd[nxt]]=g[odd[nxt]]+tr;
					}
				}
			}
			memcpy(f,g,sizeof(g));
		}
		ll mx=0,ans=0;
		for(int s=0;s<=tot;++s)
			if(f[s].mx>mx){
				mx=f[s].mx;
				ans=f[s].cnt;
			}else if(f[s].mx==mx) ans=(ans+f[s].cnt)%mod;
		cout << mx << ' ' << ans << '\n';
	}
	return 0;
}
/*
4
2 1 2
1 1 137
3 94 95
3 1998 1996
*/
