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(); for (int i = 0; true; i++) { int tmp = (int)Math.sqrt(k * 2); if (tmp * (tmp + 1) == k * 2) { int cnt = tmp + 1 + i; pr.println(cnt); for (int j = 0; j < cnt; j++) { if (j > 0) { pr.print(' '); } if (j < tmp + 1) { pr.print(1); } else { pr.print(0); } } pr.println(); return; } k /= 2; } } // --------------------------------------------------- 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); } } }