#include<bits/stdc++.h>
using namespace std;
#define O 998244353
int T,a,b,c;
inline int qkpw(int ds,int ix){
	int re=1;while(ix){
		if(ix&1)re=1ll*re*ds%O;
		ix>>=1;ds=1ll*ds*ds%O;
	}return re;
}
int main(){
	freopen("geometry.in","r",stdin);
	freopen("geometry.out","w",stdout);
	ios::sync_with_stdio(false);
	cin>>T;while(T--){
		cin>>a>>b>>c;
		cout<<3ll*a*a<<' ';
		cout<<qkpw(2,a)<<'\n';
	}
	return 0;
} 
