//https://oeis.org/A025192 import java.io.*; import java.util.*; class Main { public static void main(String args[])throws Exception { BufferedReader bu=new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb=new StringBuilder(); int t=Integer.parseInt(bu.readLine()); while(t-->0) { int n=Integer.parseInt(bu.readLine()); long M=998244353,ans=power(3,n-1,M); ans=ans*2%M; sb.append(ans+"\n"); } System.out.print(sb); } static long power(long a,long b,long M) { long res=1; while(b!=0) { if(b%2==1) res=res*a%M; b>>=1; a=a*a%M; } return res; } }