import math from math import sqrt import sys from collections import deque, defaultdict from heapq import heappop, heappush from copy import deepcopy INF=10**18 MOD=10**9+7 MAX=10**5+7 # N,K=map(int, input().split()) # A=list(map(int, input().split())) def main(): K=int(input()) if K==0: print(0) print(0) sys.exit() for N in range(31): for i in range(N+1): if pow(2, i)*(N-i)*(N-i-1)/2==K: print(N) print(" ".join("0"*i+"1"*(N-i))) sys.exit() if __name__=='__main__': main()