def main(): K = int(input()) for i in range(31): for j in range(31): if 1 <= i + j <= 30: k = (j * (j - 1) // 2) * 2 ** i if K == k: print(i + j) ans = [0] * (i + j) for k in range(j): ans[k] = 1 print(*ans) exit() if __name__ == "__main__": main()