T=int(input()) mod=998244353 for tests in range(T): N=int(input()) print(pow(3,N-1,mod)*2%mod)