# -*- coding: utf-8 -*- import sys sum = int(input()) array = [] append_zero = 0 number_one = 0 for number_one in range(2, 31): x = number_one * (number_one - 1) / 2 for append_zero in range(31): if (2 ** append_zero) * x == sum: for i in range(number_one): array.append(1) for j in range(append_zero): array.append(0) print(len(array)) for i in range(len(array)): print(array[i], end=" ") sys.exit()