Problem: Phoenix has decided to become a scientist! He is currently investigating the growth of bacteria.

Initially, on day 1, there is one bacterium with mass 1.

Every day, some number of bacteria will split (possibly zero or all). When a bacterium of mass m splits, it becomes two bacteria of mass m/2 each. For example, a bacterium of mass 3 can split into two bacteria of mass 1.5.

Also, every night, the mass of every bacteria will increase by one.

Phoenix is wondering if it is possible for the total mass of all the bacteria to be exactly n. If it is possible, he is interested in the way to obtain that mass using the minimum possible number of nights. Help him become the best scientist!

Input

The input consists of multiple test cases. The first line contains an integer t (1 ≤ t ≤ 1000) — the number of test cases.

The first line of each test case contains an integer n (2 ≤ n ≤ 10^9) — the sum of bacteria masses that Phoenix is interested in. 

Output

For each test case, if there is no way for the bacteria to exactly achieve total mass n, print -1. Otherwise, print two lines.

The first line should contain an integer d — the minimum number of nights needed.

The next line should contain d integers, with the i-th integer representing the number of bacteria that should split on the i-th day.

If there are multiple solutions, print any.

Example

Input


3
9
11
2


Output


3
1 0 2 
3
1 1 2
1
0 

Note

In the first test case, the following process results in bacteria with total mass 9: 

  * Day 1: The bacterium with mass 1 splits. There are now two bacteria with mass 0.5 each. 
  * Night 1: All bacteria's mass increases by one. There are now two bacteria with mass 1.5. 
  * Day 2: None split. 
  * Night 2: There are now two bacteria with mass 2.5. 
  * Day 3: Both bacteria split. There are now four bacteria with mass 1.25. 
  * Night 3: There are now four bacteria with mass 2.25. 

The total mass is 2.25+2.25+2.25+2.25=9. It can be proved that 3 is the minimum number of nights needed. There are also other ways to obtain total mass 9 in 3 nights.

 

In the second test case, the following process results in bacteria with total mass 11: 

  * Day 1: The bacterium with mass 1 splits. There are now two bacteria with mass 0.5. 
  * Night 1: There are now two bacteria with mass 1.5. 
  * Day 2: One bacterium splits. There are now three bacteria with masses 0.75, 0.75, and 1.5. 
  * Night 2: There are now three bacteria with masses 1.75, 1.75, and 2.5. 
  * Day 3: The bacteria with mass 1.75 and the bacteria with mass 2.5 split. There are now five bacteria with masses 0.875, 0.875, 1.25, 1.25, and 1.75. 
  * Night 3: There are now five bacteria with masses 1.875, 1.875, 2.25, 2.25, and 2.75. 

The total mass is 1.875+1.875+2.25+2.25+2.75=11. It can be proved that 3 is the minimum number of nights needed. There are also other ways to obtain total mass 11 in 3 nights.

 

In the third test case, the bacterium does not split on day 1, and then grows to mass 2 during night 1.

Solution (in JAVA):

Solution:


import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Contest {
    public static class pair implements Comparable<pair> {
        int u;
        long val;

        public pair(int a, long value) {
            u = a;
            val = value;
        }

        @Override
        public int compareTo(pair p) {
            return Long.compare(val, p.val);
        }
    }

    static int n, m;
    static ArrayList<Integer>[] adj;
    static int dist[];
    static int parent[];
    static long inf = (long) 1e16;
    static int INF = (int) 1e9;

    public static int[] bfs(int s) {
        dist = new int[n];
        Arrays.fill(dist, -1);
        dist[s] = 0;
        Queue<Integer> q = new LinkedList<>();
        q.add(s);
        while (!q.isEmpty()) {
            int u = q.poll();
            for (int v : adj[u])
                if (dist[v] == -1) {
                    dist[v] = dist[u] + 1;
                    q.add(v);
                }
        }
        return dist;
    }

    public static long calc(long[] acc, int single, int Dbl) {
        if (single + Dbl > m) return inf;
        return acc[Dbl] + acc[single + Dbl];
    }

    public static boolean subset(TreeSet<Integer> small, TreeSet<Integer> big) {
        for (int x : small)
            if (!big.contains(x))
                return false;
        return true;
    }

    public static TreeSet<Integer> subset2(TreeSet<Integer> small, TreeSet<Integer> big) {
        TreeSet<Integer> ts = new TreeSet<>();
        for (int x : small)
            if (!big.contains(x))
                ts.add(x);
        return ts;
    }

    public static boolean CanBeStart(int x, TreeSet<Integer>[] Arr) {
        TreeSet<Integer> last = new TreeSet<>();
        for (int j = 0; j < n - 1; j++)
            if (Arr[j].contains(x)) {
                if (!subset(last, Arr[j]))
                    return false;
                last = Arr[j];
            }
        return true;
    }

    public static boolean check(TreeSet<Integer> sublist, ArrayList<Integer> arr) {
        int len = sublist.size(), n = arr.size();
        for (int i = 0; i < n - len + 1; i++) {
            boolean flag = true;
            for (int j = 0; j < len; j++)
                if (!sublist.contains(arr.get(i + j)))
                    flag = false;
            if (flag) return true;
        }
        return false;
    }

    public static boolean check(TreeSet<Integer>[] Arr, ArrayList<Integer> arr) {
        boolean ans = true;
        for (int i = 0; i < n - 1; i++)
            ans &= check(Arr[i], arr);
        return ans;
    }

    public static boolean alltrue(boolean[] arr) {
        for (boolean flag : arr)
            if (flag) return false;
        return true;
    }

    public static boolean sep(boolean[] arr) {
        boolean open = false;
        int cnt = 0;
        for (int i = 0; i < arr.length; i++)
            if (open) {
                if (!arr[i]) open = false;
            } else {
                if (arr[i]) {
                    open = true;
                    cnt++;
                }
            }
        return cnt <= 1;
    }


    static int[] dx = new int[]{-1, 1, 0, 0};
    static int[] dy = new int[]{0, 0, -1, 1};
    static boolean[][] Matrix, vis;

    static boolean valid(int i, int j) {
        return i != -1 && j != -1 && i != n && j != m && Matrix[i][j];
    }

    static void dfs2(int i, int j) {
        vis[i][j] = true;                        //mark as visited
        for (int k = 0; k < 4; ++k) {
            int x = i + dx[k], y = j + dy[k];
            if (valid(x, y) && !vis[x][y])
                dfs2(x, y);
        }
    }

    public static boolean isSimilar(char[] Arr, int s, int k) {
        for (int i = s; i < k - 1; i++) {
            if (Arr[i + 1] != Arr[i])
                return false;
        }
        return true;
    }

    public static int ciel(int d, int mod) {
        if (d % mod == 0)
            return d / mod;
        return d / mod + 1;
    }

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int t = sc.nextInt();
        while (t-- > 0) {
            n = sc.nextInt()-1;
            int x = 2;
            int lastx = 1;
            ArrayList<Integer> arr = new ArrayList<>();

            while (n > 0) {
                if(x>=n){
                    arr.add(n-lastx);
                    break;
                }
                int d = n - x;
              if (d >= x) {
                    n -= x;
                    arr.add(x-lastx);
                    lastx = x;
                    x <<= 1;
                } else {
                    int dd = x - d;
                    int need = (dd + 1) / 2;
                    int newx = x - need;
                    arr.add(newx - lastx);
                    lastx = newx;
                    arr.add(d+need-lastx);
                    break;
                }

            }
            pw.println(arr.size());
            for (int xx : arr)
                pw.print(xx + " ");
            pw.println();
        }


        pw.close();

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException, IOException {
            return br.ready();
        }

    }
}