#include <bits/stdc++.h>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;

template <typename T>
inline void read(T &f) {
	f = 0; int fu = 0; char c = getchar();
	while (c < '0' || c > '9') {
		if (c == '-') fu = 1;
		c = getchar();
	}
	while (c >= '0' && c <= '9') {
		f = f * 10 + (c - '0');
		c = getchar();
	}
	if (fu) f = -f;
}

const int md = 998244353;

inline int add(int x, int y) {
	if (x + y >= md) return x + y - md;
	return x + y;
}

inline int sub(int x, int y) {
	if (x < y) return x - y + md;
	return x - y;
}

inline int mul(int x, int y) { return 1ull * x * y % md; }

inline int fpow(int x, int y) {
	int ans = 1;
	while (y) {
		if (y & 1) ans = mul(ans, x);
		y >>= 1; x = mul(x, x);
	}
	return ans;
}

struct atom {
	int cnt, ways;
	atom (int a = 0, int b = 0) : cnt(a), ways(b) {}
};

atom operator + (const atom a, const atom b) {
	int maxn = max(a.cnt, b.cnt), ans = 0;
	if (a.cnt == maxn) ans = a.ways;
	if (b.cnt == maxn) ans = add(ans, b.ways);
	return atom(maxn, ans);
}

atom f[2][1 << 15];
vector <int> s;
int T, a, b, c;

int main() {
	freopen("geometry.in", "r", stdin);
	freopen("geometry.out", "w", stdout);
	read(T);
	while (T--) {
		read(a); read(b); read(c);
		int cur = 0, len = a * 4 - 1;
		s.clear();
		for (int i = 0; i < (1 << len); i++) {
			int cando = 1;
			for (int j = 1; j < len; j++) {
				if (((i >> j) & 1) && ((i >> (j - 1)) & 1)) cando = 0;
			}
			if (cando) s.push_back(i);
		}
		for (auto i : s) f[0][i] = atom(-1, 0);
		f[0][0] = atom(0, 1);
		for (int y = -2 * b + 1; y <= 2 * b - 1; y++) {
			for (int x = -2 * a + 1; x <= 2 * a - 1; x++) {
				int id = x - (-2 * a + 1);
				for (auto i : s) f[cur ^ 1][i] = atom(-1, 0);
				for (auto i : s) {
					if (f[cur][i].cnt == -1) continue;
					int go = i;
					if ((go >> id) & 1) go ^= (1 << id);
					f[cur ^ 1][go] = f[cur ^ 1][go] + f[cur][i];
				}
				if (abs(x + y) >= 2 * c || (x % 2 == 0 && y % 2 == 0)) {
					
				} else {
					for (auto i : s) {
						if (f[cur][i].cnt == -1) continue;
						int cando = 1;
						for (int j = id - 1; j <= id + 1; j++) {
							if (j >= 0 && ((i >> j) & 1)) {
								cando = 0;
							}
						}
						if (cando) {
							int go = i | (1 << id);
							atom tmp = f[cur][i]; ++tmp.cnt;
							f[cur ^ 1][go] = f[cur ^ 1][go] + tmp;
						}
					}
				}
				cur ^= 1;
			}
		}
		atom ans = atom(-1, 0);
		for (auto i : s) ans = ans + f[cur][i];
		printf("%d %d\n", ans.cnt, ans.ways);
	}
	return 0;
}
