import java.io.*; import java.util.*; public class Main_yukicoder688 { private static Scanner sc; private static Printer pr; private static void solve() { int k = sc.nextInt(); if (k == 0) { pr.println(1); pr.println(1); return; } for (int i = 0; i <= 30; i++) { for (int j = 0; i + j <= 30; j++) { long tmp = i * (i - 1) / 2; for (int l = 0; l < j; l++) { tmp *= 2; } if (tmp == k) { pr.println(i + j); for (int jj = 0; jj < i + j; jj++) { if (jj > 0) { pr.print(' '); } if (jj < i) { pr.print(1); } else { pr.print(0); } } pr.println(); return; } } } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())); pr = new Printer(System.out); solve(); // pr.close(); pr.flush(); // sc.close(); } static String INPUT = null; private static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }