N = int(input()) if N == 1: ans = 1321 elif N == 2: ans = 12222 else: ans = 324124 print(ans)