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