n = int(input()) mod = 998244353 for i in range(n): s = int(input()) print(2*pow(3,s-1,mod)%mod)