def main(): K = int(input()) if K == 0: print(1) print(0) return for length in range(2, 31): for len_1 in range(1, length+1): if ((len_1) * (len_1 - 1) // 2) * 2 ** (length - len_1) == K: print(length) print(" ".join(list("1"*len_1 + "0"*(length-len_1)))) return if __name__ == "__main__": main()