import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(), i, j = 0; sc.close(); for (i = 1; i <= 30; ++i) { for (j = 0; j <= 30 - i; ++j) { if ((i - 1) * i / 2 * (int)Math.pow(2, j) == K) break; } if (j != 31 - i) break; } System.out.println(i + j); for (int k = 0; k < i; ++k) System.out.print("1 "); for (int l = 0; l < j; ++l) System.out.print("0 "); } }