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