import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); long n = sc.nextLong(); if (n == 0) { System.out.println(-1); return; } ArrayList ans = new ArrayList<>(); for (int i = 60; i >= 0 && n >= 4; i--) { if (n < (1L << i)) { continue; } long x = (1L << i) + 1; while (!isPrime(x)) { x += 2; } ans.add(x); n ^= x + 1; } if (n == 3) { ans.add(2L); } else if (n == 2) { ans.add(2L); ans.add(1L); } else if (n == 1) { ans.add(1L); } System.out.println(ans.size()); StringBuilder sb = new StringBuilder(); for (int i = 0; i < ans.size(); i++) { if (i > 0) { sb.append(" "); } sb.append(ans.get(i)); } System.out.println(sb); } static boolean isPrime(long x) { for (int i = 2; i <= Math.sqrt(x); i++) { if (x % i == 0) { return false; } } return true; } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }