M = 998244353 N = int(input()) if N % 2 == 0: n = N // 2 else: n = (N - 1) // 2 print(pow(6, n, M))