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