mod = 998244353 def main(): import sys input = sys.stdin.readline N = int(input()) print(pow(3, N, mod)) if __name__ == '__main__': main()