import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); sc.close(); List list = new ArrayList<>(); for (int i = 0; i < 40; i++) { if ((n >> i & 1) == 1) { list.add(1L << i); } } if (list.isEmpty()) { System.out.println(-1); } else { System.out.println(list.size()); StringBuilder sb = new StringBuilder(); for (long e : list) { sb.append(e).append(' '); } sb.deleteCharAt(sb.length() - 1); System.out.println(sb.toString()); } } }