#include <bits/stdc++.h>
using namespace std;
int vis[1000];
vector<pair<int, int> >now;
vector<int>cnt[1000];
int maxs, tot;
void dfs(int o, int zong)
{
	if(o == now.size())
	{
		if(zong > maxs) tot = 0, maxs = zong;
		if(zong == maxs) ++ tot;
		return;
	}
	dfs(o + 1, zong);
	for (int i:cnt[o]) if(vis[i]) return;
	vis[o] = 1; dfs(o + 1, zong + 1); vis[o] = 0;
}
bool check(int x1, int y1, int x2, int y2)
{
	if(x1 == x2 && y1 == y2 - 1)return 1;
	if(x1 == x2 && y1 == y2 + 1)return 1;
	if(x1 == x2 - 1 && y1 == y2)return 1;
	if(x1 == x2 + 1 && y1 == y2)return 1;
	if(x1 == x2 - 1 && y1 == y2 + 1)return 1;
	if(x1 == x2 + 1 && y1 == y2 - 1)return 1;
	return 0;
}
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 --)
	{
		for (int i = 0; i < now.size(); ++ i)cnt[i].clear(), vis[i] = 0;
		now.clear();
		maxs = tot = 0;
		int a, b, c;
		cin >> a >> b >> c;
		for (int x = -2 * a + 1; x <= 2 * a - 1; ++ x)
		for (int y = -2 * b + 1; y <= 2 * b - 1; ++ y)
		if(-2 * c + 1 <= x + y && x + y <= 2 * c - 1 && ((abs(x) & 1) || (abs(y) & 1)))
		now.push_back(make_pair(x, y));
		for (int i = 0; i < now.size(); ++ i)
		for (int j = i + 1; j < now.size(); ++ j)
		{
			if(check(now[j].first, now[j].second, now[i].first, now[i].second))
			cnt[j].push_back(i);
		}
		dfs(1, 0);
		cout << maxs << " "<< tot << "\n";
	}
}
