/**
 * @file geometry.cpp
 * @author Macesuted (i@macesuted.moe)
 * @date 2022-05-04
 *
 * @copyright Copyright (c) 2022
 */

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

bool mem1;

template <typename T = int>
T read(void) {
    T f = +1, x = 0;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-') f = -f;
        c = getchar();
    }
    while ('0' <= c && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
    return f * x;
}
template <typename T>
void write(T x) {
    if (x < 0) putchar('-'), x = -x;
    if (x > 9) write(x / 10);
    putchar((x % 10) ^ 48);
    return;
}

typedef pair<int, int> pii;

const int way[2][6] = {{0, 0, 1, -1, 1, -1}, {1, -1, 0, 0, -1, 1}};

vector<pii> A;
map<pii, int> id;

void solve(void) {
    A.clear();
    int a = read(), b = read(), c = read();
    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)
                id[{x, y}] = A.size(), A.emplace_back(x, y);
    int n = A.size(), ans = -1, anscnt = 0;
    for (int64_t S = 0; S < (1LL << n); S++) {
        int cnt = __builtin_popcountll(S);
        if (cnt < ans) continue;
        bool check = true;
        for (int i = 0; i < n && check; i++)
            if (S >> i & 1) {
                for (int t = 0; t < 6; t++) {
                    int tx = A[i].first + way[0][t], ty = A[i].second + way[1][t];
                    if (id.count({tx, ty}) && (S >> id[{tx, ty}] & 1)) {
                        check = false;
                        break;
                    }
                }
            }
        if (!check) continue;
        if (cnt > ans) ans = cnt, anscnt = 0;
        if (cnt == ans) anscnt++;
    }
    write(ans), putchar(' '), write(anscnt), putchar('\n');
    return;
}

bool mem2;

int main() {
    ios::sync_with_stdio(false);
#ifndef MACESUTED
    freopen("geometry.in", "r", stdin), freopen("geometry.out", "w", stdout);
#endif
#ifdef MACESUTED
    cerr << "Memory: " << abs(&mem1 - &mem2) / 1024. / 1024. << "MB" << endl;
#endif

    int _ = read();
    while (_--) solve();

#ifdef MACESUTED
    cerr << "Time: " << clock() * 1000. / CLOCKS_PER_SEC << "MS" << endl;
#endif
    return 0;
}