#include <bits/stdc++.h>
using namespace std;
inline int read(void) {
    int x=0,sgn=1; char c=getchar();
    while(c< '0'||'9'< c) {(c=='-'&&(sgn=0)); c=getchar();}
    while('0'<=c&&c<='9') {x=x*10+c-'0'; c=getchar();}
    return sgn ? x : -x;
}
void write(long long x) {
    if(x<0) return putchar('-'),write(-x),void();
    if(x>9) write(x/10),x%=10;
    return putchar('0'+x),void();
}
const int p=998244353;
int ksm(int x,int a) {
    if(a==0) return 1;
    if(a==1) return x;
    int tmp=ksm(x,a>>1);
    tmp=1ll*tmp*tmp%p;
    (a&1) && (tmp=1ll*tmp*x%p);
    return tmp;
}
int a,b,c;
inline void work() {
    a=read(); b=read(); c=read();
    if(a==b&&b==c) {
        if(a==1) puts("3 2");
        else if(a==2) puts("12 8"); 
        else if(a==3) puts("27 14");
        else {
            write(3ll*a*a); putchar(' '); write((ksm(2,a)+3ll*ksm(2,a-2))%p); puts("");
        } 
    } else if(c>=a+b) {
        write(4ll*a*b); puts(" 1");
    } else if(b>=a+c) {
        write(4ll*a*c); puts(" 1");
    } else if(a>=b+c) {
        write(4ll*b*c); puts(" 1");
    } else {

    }
    
}
signed main() {
    freopen("geometry.in","r",stdin);
    freopen("geometry.out","w",stdout);
    int T=read();
    while(T--) work();
    return 0;
}