## https://yukicoder.me/problems/no/2079 MOD = 998244353 def main(): N = int(input()) print(pow(3, N, MOD)) if __name__ == "__main__": main()