N = int(input()) if (N - 1 + 3) % 3 == 0: print(*([3] + [2] + [1] * (N - 2)), sep=' ') elif (N - 1 + 3) % 3 == 1: print(*([3] + [1] * (N - 1)), sep=' ') else: print(*([3] + [2] + [2] + [1] * (N - 3)), sep=' ')