N = int(input()) x = 2 * N % 3 S = '3' if x == 0: S += '22' else: S += str(x) + '1' if N == 2:print(3,1) else: S += '1' * (N-3) for i in S: print(i,end = ' ') print()