#include <bits/stdc++.h>
using namespace std;
const int N = 20005,P = 998244353;
inline void add(pair<int,int> &a,pair<int,int> b)
{ if (a.first < b.first) a = b;else if (a.first == b.first) {a.second += b.second;if (a.second >= P) a.second -= P;} }
int a,b,c;pair<int,int> f[N][1 << 11];
pair<int,int> g[10][1 << 15];
inline bool check(int msk,int x)
{
    if (x - a >= -c && x + a <= c) return 1;
    for (int j = -a;j <= a;j++)
        if ((msk >> (j + a)) & 1) if (x + j < -c || x + j > c) return 0;
    return 1;
}
int main ()
{
    freopen("geometry.in","r",stdin);
    freopen("geometry.out","w",stdout);
    ios::sync_with_stdio(false);
    int T;cin >> T;
    while (T--)
    {
        cin >> a >> b >> c;a = 2 * a - 1;b = 2 * b - 1;c = 2 * c - 1;
        int lim = 1 << (a * 2 + 1);
        if (a <= 7 && b <= 7 && c <= 7)
        {
            for (int i = 0;i <= b * 2;i++)
                for (int j = 0;j < lim;j++) g[i][j] = {0,0};
            for (int i = 0;i < lim;i++)
            {
                bool ok = check(i,-b);if (i & (i >> 1)) ok = 0;
                if (ok) g[0][i] = {__builtin_popcount(i),1};
            }
            int even = 0;for (int i = -a + 1;i < a;i += 2) even |= 1 << (i + a);
            for (int y = -b;y < b;y++)
                for (int j = 0;j < lim;j++)
                {
                    if (!g[y + b][j].second) continue;
                    for (int k = lim - 1 - (j | (j >> 1) | (even * ((y + 1) % 2 == 0))),tot = k;k > 0;k = tot & (k - 1))
                    {
                        if ((k & (k >> 1))) continue;
                        int pc = __builtin_popcount(k);
                        if (check(k,y + 1)) add(g[y + b + 1][k],{g[y + b][j].first + pc,g[y + b][j].second});
                    }
                    add(g[y + b + 1][0],g[y + b][j]);
                }
            pair<int,int> ans;for (int i = 0;i < lim;i++) add(ans,g[b * 2][i]);
            cout << ans.first << ' ' << ans.second << endl;continue;
        }
        for (int i = 0;i <= b * 2;i++)
            for (int j = 0;j < lim;j++) f[i][j] = {0,0};
        for (int i = 0;i < lim;i++)
        {
            bool ok = check(i,-b);if (i & (i >> 1)) ok = 0;
            if (ok) f[0][i] = {__builtin_popcount(i),1};
        }
        int even = 0;for (int i = -a + 1;i < a;i += 2) even |= 1 << (i + a);
        for (int y = -b;y < b;y++)
            for (int j = 0;j < lim;j++)
            {
                if (!f[y + b][j].second || !check(j,y)) continue;
                for (int k = lim - 1 - (j | (j >> 1) | (even * ((y + 1) % 2 == 0))),tot = k;k > 0;k = tot & (k - 1))
                {
                    if ((k & (k >> 1))) continue;
                    int pc = __builtin_popcount(k);
                    add(f[y + b + 1][k],{f[y + b][j].first + pc,f[y + b][j].second});
                }
                add(f[y + b + 1][0],f[y + b][j]);
            }
        pair<int,int> ans;for (int i = 0;i < lim;i++) if (check(i,b)) add(ans,f[b * 2][i]);
        cout << ans.first << ' ' << ans.second << endl;
    }
    // cerr << clock() << endl;
    return 0;
}