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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
import java.util.function.*;
import java.util.stream.*;
import java.util.stream.Collectors;


public class D {

    private static final FastReader in = new FastReader();
    private static final FastWriter out = new FastWriter();

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

    private void run() {
        var t = in.nextInt();
        while (t-- > 0) {
            solve();
        }

        out.flush();
    }

    List<Long> mass;

    private void solve() {
        var n = in.nextLong();

        mass = new ArrayList<Long>();
        split(n);

        var x = new ArrayList<Long>();
        for (var i = 0; i + 1 < mass.size(); i++) {
            x.add(mass.get(i) - mass.get(i + 1));
        }

        Collections.reverse(x);
        out.println(x.size());
        out.println(x);
    }

    void split(long x) {
        if (x == 1) {
            mass.add(1l);
            return ;
        }

        var d = Long.SIZE - 1 - Long.numberOfLeadingZeros(x);
        if (x == (1l << d)) {
            mass.add(1l << (d - 1));
            split(x / 2);
            return ;
        }

        var maxC = 1l << d;
        var minC = 1l << (d - 1);

        var l = maxC + minC;
        if (x < l) {
            mass.add(minC);
            split(x - minC);
        } else {
            var c = minC + (x - l + 1);
            mass.add(c);
            split(x - c);
        }
    }

}


class ArrayUtils {

    public static int[] of(int n, int defaultValue) {
        var a = new int[n];
        Arrays.fill(a, defaultValue);
        return a;
    }

    public static long[] of(int n, long defaultValue) {
        var a = new long[n];
        Arrays.fill(a, defaultValue);
        return a;
    }

    public static int max(int[] a) {
        return Arrays.stream(a).max().getAsInt();
    }

    public static long max(long[] a) {
        return Arrays.stream(a).max().getAsLong();
    }

    public static <T extends Comparable<? super T>> T max(T[] a) {
        return Collections.max(Arrays.asList(a));
    }

    public static int min(int[] a) {
        return Arrays.stream(a).min().getAsInt();
    }

    public static long min(long[] a) {
        return Arrays.stream(a).min().getAsLong();
    }

    public static <T extends Comparable<? super T>> T min(T[] a) {
        return Collections.max(Arrays.asList(a));
    }

    public static void sort(int[] a) {
        var al = Arrays.stream(a).boxed().collect(Collectors.toCollection(ArrayList::new));
        Collections.shuffle(al);
        Collections.sort(al);

        for (var i = 0; i < a.length; i++) {
            a[i] = al.get(i);
        }
    }

    public static void sort(long[] a) {
        var al = Arrays.stream(a).boxed().collect(Collectors.toCollection(ArrayList::new));
        Collections.shuffle(al);
        Collections.sort(al);

        for (var i = 0; i < a.length; i++) {
            a[i] = al.get(i);
        }
    }

    public static void reverse(int[] a) {
        for (int l = 0, r = a.length - 1; l <= r; l++, r--) {
            var t = a[l];
            a[l] = a[r];
            a[r] = t;
        }
    }

    public static void reverse(long[] a) {
        for (int l = 0, r = a.length - 1; l <= r; l++, r--) {
            var t = a[l];
            a[l] = a[r];
            a[r] = t;
        }
    }

}


class FastReader {

    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static StringTokenizer in;

    public String next() {
        while (in == null || !in.hasMoreTokens()) {
            try {
                in = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                return null;
            }
        }
        return in.nextToken();
    }

    public BigDecimal nextBigDecimal() {
        return new BigDecimal(next());
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }

    public boolean nextBoolean() {
        return Boolean.valueOf(next());
    }

    public byte nextByte() {
        return Byte.valueOf(next());
    }

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

    public double[] nextDoubleArray(int length) {
        var a = new double[length];
        for (var i = 0; i < length; i++) {
            a[i] = nextDouble();
        }
        return a;
    }

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

    public int[] nextIntArray(int length) {
        var a = new int[length];
        for (var i = 0; i < length; i++) {
            a[i] = nextInt();
        }
        return a;
    }

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

    public long[] nextLongArray(int length) {
        var a = new long[length];
        for (var i = 0; i < length; i++) {
            a[i] = nextLong();
        }
        return a;
    }

}


class FastWriter extends PrintWriter {

    public FastWriter() {
        super(System.out);
    }

    public void println(boolean[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(double[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(int[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(long[] a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public void println(Object... a) {
        for (var i = 0; i < a.length; i++) {
            print(a[i]);
            print(i + 1 < a.length ? ' ' : '\n');
        }
    }

    public <T> void println(List<T> l) {
        println(l.toArray());
    }

    public void debug(String name, Object o) {
        String value = Arrays.deepToString(new Object[] { o });
        value = value.substring(1, value.length() - 1);
        System.err.println(name + " => " + value);
    }

}