MOD = 998244353 n = int(input()) print(pow(3, n, MOD))