mod = 998244353 N = int(input()) ans = pow(3, N, mod) print(ans)