from collections import deque import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict from functools import lru_cache # for AtCoder Easy test if __file__ == 'prog.py': pass else: sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') input = sys.stdin.readline def readints(): return map(int, input().split()) def readlist(): return list(readints()) def readstr(): return input()[:-1] N = int(input()) print(pow(3, N, 998244353))