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