K = int(input()) for i in range(2,31): for j in range(30-i): if K == i*(i-1)//2*pow(2,j): print(i+j) print(*([1]*i+[0]*j)) exit()