k = int(input()) l = [] for i in range(31): for j in range(31): if (i-1)*i/2 * 2**j == k: l.append([i, j]) l2 = list('0' * l[0][0] + '1' * l[0][1]) print(sum(l[0])) print(' '.join(l2))