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