import sys sys.setrecursionlimit(100000000) input = sys.stdin.readline MOD = 10 ** 9 + 7 INF = 10 ** 15 def main(): K = int(input()) factorial = [1] for i in range(1,35): factorial.append(factorial[-1]*i) nck = lambda n,k: factorial[n]//factorial[k]//factorial[n - k] N = 0 one = 0 for i in range(1,31): for j in range(i + 1): if nck(j,2)*pow(2,i - j) == K: N = i one = j print(N) print(*([0]*(N - one) + [1]*one)) if __name__ == '__main__': main()