import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); if (k == 0) { System.out.println(1); System.out.println(1); return; } HashMap map = new HashMap<>(); for (int i = 2; i <= 30; i++) { map.put(i * (i - 1) / 2, i); } int count0 = 0; int count1 = 0; while (k > 0) { if (map.containsKey(k)) { count1 = map.get(k); if (count1 + count0 <= 30) { break; } } count0++; k /= 2; } StringBuilder sb = new StringBuilder(); sb.append(count0 + count1).append("\n"); for (int i = 0; i < count1; i++) { if (i != 0) { sb.append(" "); } sb.append("1"); } for (int i = 0; i < count0; i++) { sb.append(" ").append("0"); } System.out.println(sb); } }