#include <bits/stdc++.h>
using namespace std;
#define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout);
#define rep(i, a, b) for(ll i = (a); i <= (b); ++ i)
#define per(i, a, b) for(ll i = (a); i >= (b); -- i)
#define pb push_back
#define fi first
#define se second
typedef long long ll;
const int maxn = 8e5 + 100;
const ll mod = 998244353;
ll read()
{
	ll x;
	scanf("%lld", &x);
	return x;
}

ll chmin(ll &a, ll b){return a = min(a, b);}
ll chmax(ll &a, ll b){return a = max(a, b);}

ll t, a, b, c, tot;

pair <ll, ll> p[maxn];

ll vis[5005][5005];

ll dx[] = {0, 0, 1, -1, 1, -1}, dy[] = {1, -1, 0, 0, -1, 1}, base = 1000;

ll check(ll mask)
{
	rep(i, 1, tot) vis[p[i].fi + base][p[i].se + base] = mask >> (i - 1) & 1;
	ll ret = 1;
	rep(i, 1, tot)
	{
		if(mask >> (i - 1) & 1)
		{
			rep(k, 0, 5) if(vis[p[i].fi + base + dx[k]][p[i].se + base + dy[k]]) ret = 0;
		}
	}
	rep(i, 1, tot) vis[p[i].fi + base][p[i].se + base] = 0;
	return ret;
}

signed main()
{
	file("geometry");
	t = read();
	while(t --)
	{
		a = read(), b = read(), c = read(), tot = 0;
		rep(i, -2 * a + 1, 2 * a - 1) rep(j, -2 * b + 1, 2 * b - 1)
		{
			if(i + j < -2 * c + 1 || i + j > 2 * c - 1) continue;
			if(i & 1 || j & 1)
			{
				p[++ tot] = make_pair(i, j);
//				printf("%lld %lld\n", i, j);
			}
		}
		ll lim = (1 << tot) - 1;
		ll ans = 0, mx = 0;
		per(i, lim, 1)
		{
			ll cnt = __builtin_popcount(i);
			if(cnt < mx) continue;
			if(check(i))
			{
				if(cnt > mx) mx = cnt, ans = 0;
				if(cnt == mx) ans ++;
			}
		}
		printf("%lld %lld\n", mx, ans);
	}
	return 0;
}