#include <iostream>
#include <cstdlib>
#include <cstring>
#include <algorithm>

#define ri int
#define ll long long
#define pii pair<int,int>

using namespace std;

const ll mod=998244353,inv2=mod+1>>1;
ll add(ll x,ll y){return (x+=y)<mod?x:x-mod;}
ll dec(ll x,ll y){return (x-=y)<0?x+mod:x;}
ll ksm(ll d,ll t,ll res=1){for(;t;t>>=1,d=d*d%mod) if(t&1) res=res*d%mod;return res;}

int a,b,c;
namespace Sub1{
    pii dp[2][1<<15],emp;
    void calc(pii &p,const pii &q){
        if(p.first==q.first) p.second=add(p.second,q.second);
        else if(p<q) p=q;
    }
    int tot,L;
    int main(){
        L=(2*a-1)-(1-2*a)+1;
        tot=(1<<L)-1;
        emp=(pii){-1000000000,0};
        for(ri i=0;i<1<<L;++i) dp[0][i]=dp[1][i]=emp;
        int o=0;
        dp[o][0]=(pii){0,1};
        for(ri y=-2*b+1;y<=2*b-1;++y) for(ri x=-2*a+1;x<=2*a-1;++x){
            for(ri i=0;i<(1<<L);++i) dp[o^1][i]=emp;
            for(ri s=0;s<(1<<L);++s) calc(dp[o^1][(s<<1)&tot],dp[o][s]);
            if(x+y>=-2*c+1&&x+y<=2*c-1&&((x&1)||(y&1))) {
                for(ri s=0;s<(1<<L);++s) if(dp[o][s].second){
                    // puts("fuck");
                    // printf("[%d %d %d]\n",x,y,s);
                    int up=0,leftup=0,left=0,leftdown=0;
                    if(x>-2*a+1&&(s&1)) up=1;
                    if(y>-2*b+1&&(s>>L-1&1)) left=1;
                    if(y>-2*b+1&&x<2*a-1&&(s>>L-2&1)) leftup=1;
                    // if(y>-2*b+1&&x>-2*a+1&&(s>>L-1&1)) leftdown=1;
                    int t=(s<<1)&tot;t|=1;
                    if(!up&&!leftup&&!left&&!leftdown) calc(dp[o^1][t],(pii){dp[o][s].first+1,dp[o][s].second});
                }
            }
            o^=1;
        }
        pii ans=emp;
        for(ri s=0;s<(1<<L);++s) calc(ans,dp[o][s]);
        printf("%d %d\n",ans.first,ans.second);
        return 0;
    }
}
int solve(){
    scanf("%d%d%d",&a,&b,&c);
    // if(a>b) swap(a,b);
    if(a<=4) return Sub1::main();
    return 0;
}
int main() {
    freopen("geometry.in","r",stdin);
    freopen("geometry.out","w",stdout);
   int T;cin>>T;while(T--) solve();
}