#include<bits/stdc++.h>
#define L(i, j, k) for(int i = (j); i <= (k); ++i) 
#define R(i, j, k) for(int i = (j); i >= (k); --i)
#define sz(a) ((int) (a).size())
#define vi vector < int > 
#define me(a, x) memset(a, x, sizeof(a)) 
#define ll long long
using namespace std;
const int N = 1e5 + 7, mod = 998244353;

int a, b, c, MX, rc[1 << 15], dp[1 << 15], fw[1 << 15];
int new_dp[1 << 15], new_fw[1 << 15], tot;

vi can[1 << 15];
bool ok[1 << 15];
int bt[1 << 15];
int ik[N], mp[N];

vi scan[N];

void Main() {
	tot = 0;
	cin >> a >> b >> c;
	if(a > 4) return ;
	MX = (1 << (a * 4 - 1));
	tot = 0;
	L(i, 0, MX - 1) {
		ok[i] = ((i & (i >> 1)) == 0);
		if(ok[i]) ik[i] = ++tot, mp[tot] = i, rc[tot] = bt[i], can[tot].clear(), scan[tot].clear();
	}
	int cnt = 0;
	L(i, 1, tot) L(j, 1, tot) 
		if((mp[i] & mp[j]) == 0 && ((mp[i]) & (mp[j] << 1)) == 0) 
			can[j].emplace_back(i);
	L(i, 1, tot) {
		bool ok = true;
		for(int p = 1; p <= a * 4 - 2; p += 2) if(mp[i] >> p & 1) ok = false;
		if(!ok) continue;
		L(j, 1, tot) 
			if((mp[i] & mp[j]) == 0 && ((mp[i]) & (mp[j] << 1)) == 0) 
				scan[j].emplace_back(i);
	} 
	memset(dp, -0x3f, sizeof(dp)), memset(fw, 0, sizeof(fw));
	dp[ik[0]] = 0, fw[ik[0]] = 1;
	L(y, -b * 2 + 1, b * 2 - 1) {
		int l = max(- c * 2 + 1 - y, - a * 2 + 1), r = min(c * 2 - 1 - y, a * 2 - 1);
		l += a * 2 - 1;
		r += a * 2 - 1;
		L(i, 1, tot) new_dp[i] = -1e9, new_fw[i] = 0;
		L(i, 1, tot) {
			int msk = mp[i], ok = true;
			L(p, 0, a * 4 - 2) if((mp[i] >> p & 1) && (p < l || p > r)) ok = false;
			if(!(y & 1)) {
				for(int p = 1; p <= a * 4 - 2; p += 2) 
					if(mp[i] >> p & 1) ok = false;
			}
			if(!ok) continue ;
			int mx = -1e9;
			if(y & 1) {
				for(const int &u : scan[i]) mx = max(mx, dp[u]);
			} else {
				for(const int &u : can[i]) mx = max(mx, dp[u]);
			}
			new_dp[i] = mx + rc[i];
			if(mx < 0) continue ;
			if(y & 1) {
				for(const int &u : scan[i]) if(mx == dp[u]) (new_fw[i] += fw[u]) %= mod;
			} else {
				for(const int &u : can[i]) if(mx == dp[u]) (new_fw[i] += fw[u]) %= mod;
			}
//			if(new_fw[i]) 
//				cout << "fw = " << new_fw[i] << endl;
		}
		L(i, 1, tot) dp[i] = new_dp[i], fw[i] = new_fw[i];
	}
	int mx = 0, sum = 0;
	L(i, 1, tot) mx = max(mx, dp[i]); 
	L(i, 1, tot) if(dp[i] == mx) (sum += fw[i]) %= mod;
	cout << mx << ' ' << sum << '\n';
}

int main() {
	freopen("geometry.in", "r", stdin);
	freopen("geometry.out", "w", stdout);
	ios :: sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	L(i, 0, (1 << 15) - 1) 
		bt[i] = bt[i >> 1] + (i & 1);
	int t ;
	cin >> t;
	while(t--) Main();
	return 0;
}
