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

//#define int long long
#define rep(i, a, b) for(int i = a; i <= b; ++i)
#define per(i, a, b) for(int i = a; i >= b; --i)
#define siz(a) ((int)(a.size()))
#define vi vector<int>
#define PB emplace_back

int a, b, c, dx[6] = {-1, -1, 0, 0, 1, 1}, dy[6] = {0, 1, -1, 1, -1, 0}, s1, s2;
#define pii pair<int, int>
#define MP make_pair
map<pii, bool> mp;

bool ck(int n, int m) {
	rep(i, 0, 5) if(mp[MP(n + dx[i], m + dy[i])]) return 0;
	return 1;
}

void dfs(int x, int y, int n, int cnt) {
//	s1 = max(s1, n);
//	cout << x << ' ' << y << ' ' << n << endl;
	if(cnt >= 7) return;
	if(y > 2 * b - 1) {
		if(n > s1) s1 = n, s2 = 1;
		else if(n == s1) ++s2;
		return;
	}
	if(x > 2 * a - 1) return dfs(-2 * a + 1, y + 1, n, cnt), void();
	dfs(x + 1, y, n, cnt + 1);
	if(!ck(x, y) || (x & 1) + (y & 1) == 0 || x + y < -2 * c + 1 || x + y > 2 * c - 1) return;
	mp[MP(x, y)] = 1;
	dfs(x + 1, y, n + 1, 0);
	mp[MP(x, y)] = 0;
}

signed main() {
	freopen("geometry.in", "r", stdin);
//	freopen("in.in", "r", stdin);
	freopen("geometry.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
//	rep(i, 1, 20) cout << " = mp[" << (1 << i) << "]";
//	return 0;
	int T;
	for(cin >> T; T--; ) {
		cin >> a >> b >> c;
		dfs(-2 * a + 1, -2 * b + 1, 0, 0);
		cout << s1 << ' ' << s2 << '\n';
	}
	return 0;
}
