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:
// package cf.cf1348;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.util.function.IntConsumer;

public class CFD {
    private static final String INPUT = "3\n" +
            "9\n" +
            "11\n" +
            "2\n";
    private static final int MOD = 1_000_000_007;

    FastScanner sc;
    PrintWriter out;

    public static void main(String[] args) {
        new CFD().run();
    }

    public CFD() {
        sc = new FastScanner(oj ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
        out = new PrintWriter(System.out);
    }

    public void run() {
        long start = System.currentTimeMillis();
        times(sc.nextInt(), this::solve);
        out.flush();
        tr(System.currentTimeMillis() - start + "ms");
    }

    public void solve(int time) {
        int n = sc.nextInt();
        int m = 1;
        int c = 1;

        int high = Integer.highestOneBit(n);
        int steps = Integer.numberOfTrailingZeros(high);
        List<Integer> ans = new ArrayList<>();
        while (steps > 0) {
            int bs = binSearch(m, c, steps, n, c, 2*c + 1);
            ans.add(bs-c);
            c = bs;
            m += c;
            steps--;
        }

        writeln(ans.size());
        for (Integer an : ans) {
            write(an + " ");
        }
        writeln();
    }

    int binSearch(int m, int c, int step, int goal, int l, int r) { // l inclusive, r exclusive
        while (l < r - 1) {
            int med = (l + r) / 2;
            if (m + med*step > goal) {
                r = med;
            } else {
                l = med;
            }
        }
        return l;
    }

    //---------------------------------------------------------------------------------------------------

    /**
     * If searched element doesn't exist, returns index of first element which is bigger than searched value.<br>
     * If searched element is bigger than any array element function returns first index after last element.<br>
     * If searched element is lower than any array element function returns index of first element.<br>
     * If there are many values equals searched value function returns first occurrence.<br>
     */
    private static int lowerBound(long[] arr, long key) {
        int lo = 0;
        int hi = arr.length - 1;
        while (lo < hi) {
            int mid = (lo + hi) / 2;
            if (key <= arr[mid]) {
                hi = mid - 1;
            } else {
                lo = mid + 1;
            }
        }
        return arr[lo] < key ? lo + 1 : lo;
    }

    /**
     * Returns index of first element which is grater than searched value.
     * If searched element is bigger than any array element, returns first index after last element.
     */
    private static int upperBound(long[] arr, long key) {
        int lo = 0;
        int hi = arr.length - 1;
        while (lo < hi) {
            int mid = (lo + hi) / 2;
            if (key >= arr[mid]) {
                lo = mid + 1;
            } else {
                hi = mid;
            }
        }
        return arr[lo] <= key ? lo + 1 : lo;
    }

    private long[] prefixSum(long[] array) {
        long[] result = new long[array.length];
        result[0] = array[0];
        for (int i = 1; i < array.length; i++) result[i] = result[i - 1] + array[i];
        return result;
    }

    private int[] sort(int[] array) {
        shuffle(array);
        Arrays.sort(array);
        return array;
    }

    private static void shuffle(int[] array) {
        Random random = new Random();
        for (int i = array.length - 1; i > 0; i--) {
            int index = random.nextInt(i + 1);
            {
                int tmp = array[index];
                array[index] = array[i];
                array[i] = tmp;
            }
        }
    }

    private long[] sort(long[] array) {
        shuffle(array);
        Arrays.sort(array);
        return array;
    }

    private static void shuffle(long[] array) {
        Random random = new Random();
        for (int i = array.length - 1; i > 0; i--) {
            int index = random.nextInt(i + 1);
            {
                long tmp = array[index];
                array[index] = array[i];
                array[i] = tmp;
            }
        }
    }

    static class ExitException extends RuntimeException {
    }

    private int iread() {
        int res = sc.nextInt();
        if (res <= 0) {
            throw new ExitException();
        }
        return res;
    }

    private void iwrite(char[] chars) {
        for (char chr : chars) {
            out.print(chr);
        }
        out.println();
        out.flush();
    }

    private void write(Object obj) {
        out.print(obj);
    }

    private void writeln(Object obj) {
        out.println(obj);
    }

    private void writeln() {
        out.println();
    }

    private void answer(Object ans) {
        out.println(ans);
        throw new ExitException();
    }

    private void times(int n, IntConsumer consumer) {
        for (int i = 0; i < n; i++) {
            try {
                consumer.accept(i);
            } catch (ExitException ignored) {
            }
        }
    }

    private int[] readIntArray(int n) {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = sc.nextInt();
        }
        return res;
    }

    private long[] readLongArray(int n) {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = sc.nextLong();
        }
        return res;
    }

    static class FastScanner {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        FastScanner(InputStream stream) {
            this.stream = stream;
        }

        int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) return -1;
            }
            return buf[curChar++];
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        boolean isEndline(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

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

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

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c)) c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isEndline(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndline(c));
            return res.toString();
        }

    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

    private void tr(Object... o) {
        if (!oj) System.out.println(Arrays.deepToString(o));
    }
}