n = int(input()) result = [1] * (n - 1) if n % 3 == 2: result.append(3) elif n % 3 == 1: result.append(1) else: result.append(2) for i in result: print(i, end=' ') print()