N = int(input()) ans = [3] + [1] * (N - 1) if (N - 1) % 3 == 0: ans[1] = 2 elif (N - 1) % 3 == 1: pass else: ans[1] = 3 for ans_i in ans[:-1]: print(ans_i, end=' ') print(ans[-1])