#coding utf-8 #https://yukicoder.me/problems/no/688 #No.688 E869120 and Constructing Array 2 import math k = int(input()) a = 0 n = 0 i = 0 j = 0 def permutations_count(n,r): return math.factorial(n) // math.factorial(n - r) for i in range(0,30): if i > 1: n = int(permutations_count(i,2) / 2) for j in range(0,30): a = n * (2 ** j) if a == k: break if a == k: break print(i + j) for k in range(0,j): print('0', end=" ") for l in range(0,i): print('1', end=" ") print()