N = int(input()) x = 2 * N % 3 S = '3' if x == 0: S += '22' else: S += str(x) + '1' if N == 2:print(31) else:print(S + '1' * (N-3))