import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long K = scan.nextLong(); scan.close(); int index1 = 2; int index2 = 0; int flag = 0; for(int i = 2; i < 30; i++) { long x = comb(i, 2); index1 = i; for(int j = 0; j < 30 - i; j++) { long y; y = (long)Math.pow(2, j); if(x * y == 2 * K) { index2 = j; flag = 1; break; } } if(flag == 1) { break; } } System.out.println(index1 + index2 - 1); for(int i = 0; i < index1; i++) { if(i == index1 - 1) { System.out.print(1); }else { System.out.print(1 + " "); } } for(int i = 1; i < index2 - 1; i++) { if(i == 1) { System.out.print(" " + 0 + " "); } if(i == index2 - 1) { System.out.print(0); }else { System.out.print(0 + " "); } } System.out.println(); } // n >= m public static long comb(int n, int r) { if (n - r < r) r = n - r; if (r == 0) return 1; if (r == 1) return n; int[] num = new int[r]; int[] den = new int[r]; for (int k = 0; k < r; k++){ num[k] = n - r + k + 1; den[k] = k + 1; } for (int p = 2; p <= r; p++) { int pivot = den[p - 1]; if (pivot > 1) { int offset = (n - r) % p; for (int k = p - 1; k < r; k += p) { num[k - offset] /= pivot; den[k] /= pivot; } } } long result = 1; for (int k = 0; k < r; k++) { if (num[k] > 1) result *= num[k]; } return result; } }