#include<stdio.h>
#include<vector>
#include<algorithm>
#include<queue>
#include <string>
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef pair<ll, ll>pii;
//typedef bitset<19> mask;
//int x4[4]={1,0,0,-1};
//int y4[4]={0,1,-1,0};
int n,q,t,x,ans,c,m;
vector<pair<int,int>>v;
set<int >a[400000];

int main()
{
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);

cin>>n>>q;
for(int i=1;i<=q;i++)
{
    scanf("%d%d",&t,&x);
    if(t==1)
    {
        ans++;
        m++;
        a[x].insert(m);
        v.push_back({x,m});
        printf("%d\n",ans);
    }
    else if(t==2)
    {
        ans-=a[x].size();
        a[x].clear();
        printf("%d\n",ans);
    }
    else
    {
        for(int j=c;j<x;j++)
        {
            if(a[v[j].first].size()>0&&*a[v[j].first].begin()==v[j].second)
            {
                a[v[j].first].erase(a[v[j].first].begin());
                ans--;
            }

        }
        c=x;

        printf("%d\n",ans);

    }
}

return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include<queue>
#include <string>
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef pair<ll, ll>pii;
//typedef bitset<19> mask;
//int x4[4]={1,0,0,-1};
//int y4[4]={0,1,-1,0};
int n,q,t,x,ans,c,m,b[400000];
vector<pair<int,int>>v;
vector<int >a[400000];

int main()
{
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);

cin>>n>>q;
for(int i=1;i<=q;i++)
{
    scanf("%d%d",&t,&x);
    if(t==1)
    {
        ans++;
        m++;
        a[x].push_back(m);
        v.push_back({x,m});
        printf("%d\n",ans);
    }
    else if(t==2)
    {
        ans-=a[x].size()-b[x];
        b[x]+=a[x].size()-b[x];
        printf("%d\n",ans);
    }
    else
    {
        for(int j=0;j<x;j++)
        {
            if(a[v[j].first].size()>0&&a[v[j].first][b[v[j].first]]==v[j].second)
            {
                ans--;
                b[v[j].first]++;
            }

        }

        printf("%d\n",ans);

    }
}

return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include<queue>
#include <string>
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef pair<ll, ll>pii;
//typedef bitset<19> mask;
//int x4[4]={1,0,0,-1};
//int y4[4]={0,1,-1,0};
int n,q,t,x,ans,c,m;
vector<pair<int,int>>v;
vector<int >a[400000];

int main()
{
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);

cin>>n>>q;
for(int i=1;i<=q;i++)
{
    scanf("%d%d",&t,&x);
    if(t==1)
    {
        ans++;
        m++;
        a[x].push_back(m);
        v.push_back({x,m});
        printf("%d\n",ans);
    }
    else if(t==2)
    {
        ans-=a[x].size();
        a[x].clear();
        printf("%d\n",ans);
    }
    else
    {
        for(int j=c;j<x;j++)
        {
            if(a[v[j].first].size()>0&&a[v[j].first][0]==v[j].second)
            {
                a[v[j].first].erase(a[v[j].first].begin());
                ans--;
            }

        }
        c=x;

        printf("%d\n",ans);

    }
}

return 0;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
#include<queue>
#include <string>
#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
typedef pair<ll, ll>pii;
//typedef bitset<19> mask;
//int x4[4]={1,0,0,-1};
//int y4[4]={0,1,-1,0};
int n,q,t,x,ans,c,m,b[400000];
vector<pair<int,int>>v;
vector<int >a[400000];

int main()
{
//freopen("hotel.in","r",stdin);
//freopen("math.in","w",stdout);

cin>>n>>q;
for(int i=1;i<=q;i++)
{
    scanf("%d%d",&t,&x);
    if(t==1)
    {
        ans++;
        m++;
        a[x].push_back(m);
        v.push_back({x,m});
        printf("%d\n",ans);
    }
    else if(t==2)
    {
        ans-=(a[x].size()-b[x]);
        b[x]=a[x].size();
        printf("%d\n",ans);
    }
    else
    {
        for(int j=c;j<x;j++)
        {
            if(a[v[j].first].size()>0&&a[v[j].first][b[v[j].first]]==v[j].second)
            {
                ans--;
                b[v[j].first]++;
            }

        }
        c=max(c,x);

        printf("%d\n",ans);

    }
}

return 0;
}


from collections import deque
def solve():
    n=int(input())
    mass,d=0,1
    summ=deque()
    while mass<n:
        mass+=2**(d-1)
        summ.append(2**(d-1))
        d+=1
    if mass==n:
        print(d-2)
        print(*summ)
    elif mass>n:
        diff=mass-n
        j=d-3
        while diff>=summ[j]:
            summ[j+1]=summ[j]
            diff=diff-summ[j]
            j-=1
        if diff<summ[j]:
            maxx=2*summ[j]
            minn=summ[j]
            if maxx-diff>=minn:
                summ[j+1]=maxx-diff
            else:
                print(-1)
                return
        print(d-2)
        for i in range(1,d-1):
            print(summ[i]-summ[i-1],end=' ')
        print()

t=int(input())
for i in range(t):
    solve()


from collections import deque
def solve():
    n=int(input())
    mass,d=0,1
    summ=deque()
    while mass<n:
        mass+=2**(d-1)
        summ.append(2**(d-1))
        d+=1
    if mass==n:
        print(d-2)
        for i in range(d-2):
            print(summ[i],end=' ')
    elif mass>n:
        diff=mass-n
        j=d-3
        while diff>summ[j]:
            summ[j+1]=summ[j]
            diff=diff-summ[j]
            j-=1
        if diff<=summ[j]:
            maxx=2*summ[j]
            minn=summ[j]
            if maxx-diff>=minn:
                summ[j+1]=maxx-diff
        print(d-2)
        for i in range(1,d-1):
            print(summ[i]-summ[i-1],end=' ')
        print()

t=int(input())
for i in range(t):
    solve()


import sys
input = sys.stdin.readline

t = int(input())
for _ in range(t):
    tmass = 1
    nbac = 1
    d = 0
    s = []
    n = int(input())
    if n > 1:
        while tmass < n:
            s.append(nbac)
            nbac *= 2
            tmass += nbac
            d += 1
        dm = tmass - n
        if dm != 0:
            while dm > 2**(len(s)-1):
                if s[-2] == 1:
                    s[-2] =0
                    dm -= 2
                else:
                    s[-2] = int(s[-2]/2)
                    dm -= 2*s[-2]
            s[-1] = s[-1] - dm
        print(d)
        print(' '.join(map(str, s)))
    else:
        print(-1)


for t in range(int(input())):
    n = s = int(input())
    l = []
    cur = 1
    while n >= cur:
        n -= cur
        l += [cur]
        cur *= 2
    if n:
        left = 0
        right = len(l) - 1
        while right > left:
            mid = (right + left) // 2
            if mid > n:
                right = mid - 1
            elif mid < n:
                left = mid + 1
            else:
                break
        l = l[:left] + [n] + l[left:]
    print(len(l) - 1)
    st = ""
    for i in range(len(l) - 1):
        st += " " + str(l[i + 1] - l[i])
    print(st[1:])


for t in range(int(input())):
    n = s = int(input())
    l = []
    cur = 1
    while n >= cur:
        n -= cur
        l += [cur]
        cur *= 2
    if n:
        left = 0
        right = len(l) - 1
        if n > l[-1]:
            l+=[n]
        else:
            while right > left:
                mid = (right + left) // 2
                if mid > n:
                    right = mid - 1
                elif mid < n:
                    left = mid + 1
                else:
                    break
            l = l[:left] + [n] + l[left:]
    print(len(l) - 1)
    st = ""
    for i in range(len(l) - 1):
        st += " " + str(l[i + 1] - l[i])
    print(st[1:])


for t in range(int(input())):
    n = s = int(input())
    l=[]
    cur = 1
    while n >= cur:
        n-=cur
        l+=[cur]
        cur*=2
    if n:
        l+=[n]
    print(len(l)-1)
    l.sort()
    st=""
    for i in range(len(l)-1):
        st+=" "+str(l[i+1]-l[i])
    print(st[1:])


for t in range(int(input())):
    n = s = int(input())
    l = []
    cur = 1
    while n >= cur:
        n -= cur
        l += [cur]
        cur *= 2
    if n:
        l += [n]
    print(len(l) - 1)
    l.sort()
    st = ""
    for i in range(len(l) - 1):
        st += " " + str(l[i + 1] - l[i])
    print(st[1:])


for t in range(int(input())):
    n = s = int(input())
    l=[]
    cur = 1
    while n >= cur:
        n-=cur
        l+=[cur]
        cur*=2
    l+=[n]
    print(len(l)-1)
    l.sort()
    st=""
    for i in range(len(l)-1):
        st+=" "+str(l[i+1]-l[i])
    print(st[1:])


import math

def process_test_case(i_test):
    n = int(input())
    n_days = math.floor(math.log2(n))

    out_list = []
    n_threshold = int(pow(2, n_days) + pow(2, n_days - 1) - 1)
    if n >= n_threshold:
        for i in range(n_days - 1):
            out_list.append(str(int(pow(2, i))))
        out_list.append(str(int(n - n_threshold)))
    else:
        for i in range(n_days - 2):
            out_list.append(str(int(pow(2, i))))
        n_reminder = n - pow(2, n_days) + 1
        a = n_reminder // 2
        b = n_reminder - 2 * a
        out_list.append(str(a))
        out_list.append(str(b))

    print(int(n_days))
    print(' '.join(out_list))

n_tests = int(input())
for i_test in range(1, n_tests + 1):
    process_test_case(i_test)


import math

def task(n):
    amount = 1
    mass = 1
    days = 0
    adds = []

    while True:
        if mass + 4 * amount <= n:
            news = amount
        elif n - mass - amount <= amount:
            news = n - mass - amount
        else:
            news = 0

        amount += news
        adds.append(news)
        mass += amount

        days += 1

        if mass == n:
            break

    print(days)
    print(" ".join(map(str, adds)))

    #print(n, k, s, mn, mx)

t = int(input())
for i in range(0, t):
    n = int(input())
    task(n)


import math

def task(n):
    amount = 1
    mass = 1
    days = 0
    adds = []

    while True:
        if mass + 4 * amount <= n:
            news = amount
        elif mass + 2 * amount >= n:
            news = n - mass - amount
        else:
            news = max(0, math.floor((n - mass - amount * 2) / 2))

        amount += news
        adds.append(news)
        mass += amount

        days += 1

        if mass == n:
            break

    print(days)
    print(" ".join(map(str, adds)))

    #print(n, k, s, mn, mx)

t = int(input())
for i in range(0, t):
    n = int(input())
    task(n)


t = int(input())

for i in range(t):
    n = int(input())
    gap = n - 1
    bact = 1
    days = []

    while gap != 0:
        if gap <= 2 * bact:
            days.append(gap - bact)
            bact = gap
            break
        if gap >= 4 * bact:
            days.append(bact)
            bact *= 2
        else:
            new_bact = gap // 2
            days.append(new_bact - bact)
            bact = new_bact
        gap -= bact

    print(len(days))
    print(' '.join(map(str, days)))


"""T=int(input())
for _ in range(0,T):
    n=int(input())
    a,b=map(int,input().split())
    s=input()
    s=[int(x) for x in input().split()]
    for i in range(0,len(s)):
        a,b=map(int,input().split())"""

"""def rec(ele,tot,L,n):
    L.append(ele)
    if(tot+ele==n):
        return L
    if(tot+(2*ele)<=n):
        rec(2*ele,tot+(2*ele),L,n)
    else:
        if(tot+ele>n):
            req=n-tot
            rec(req,L,n)
        else:
            rr=L.pop()
            rr-=1
            rec(rr,L,n)"""

import sys
sys.setrecursionlimit(10**8)

def rec(tot,L,n):
    rr=L[-1]
    if(tot==n):
        L=L[1:]
        ans=[]
        for i in range(1,len(L)):
            ans.append(L[i]-L[i-1])
        print(len(ans))
        print(*ans)
        return
    else:
        if(tot+(2*rr)<=n):
            L.append(2*rr)
            rec(tot+(2*rr),L,n)
        else:
            if(tot+rr<=n):
                req=n-tot
                L.append(req)
                rec(tot+req,L,n)
            else:
                ele=L.pop()
                sumu=tot-ele
                while(ele==L[-1]):
                    ele=L.pop()
                    sumu-=ele
                ele-=1
                sumu+=ele
                L.append(ele)
                rec(sumu,L,n)

T=int(input())
for _ in range(0,T):
    n=int(input())
    h=[0,1]
    rec(1,h,n)


"""T=int(input())
for _ in range(0,T):
    n=int(input())
    a,b=map(int,input().split())
    s=input()
    s=[int(x) for x in input().split()]
    for i in range(0,len(s)):
        a,b=map(int,input().split())"""

"""def rec(ele,tot,L,n):
    L.append(ele)
    if(tot+ele==n):
        return L
    if(tot+(2*ele)<=n):
        rec(2*ele,tot+(2*ele),L,n)
    else:
        if(tot+ele>n):
            req=n-tot
            rec(req,L,n)
        else:
            rr=L.pop()
            rr-=1
            rec(rr,L,n)"""

import sys
sys.setrecursionlimit(10**8)

def rec(tot,L,n):
    rr=L[-1]
    if(tot==n):
        L=L[1:]
        ans=[]
        for i in range(1,len(L)):
            ans.append(L[i]-L[i-1])
        print(len(ans))
        print(*ans)
    else:
        if(tot+(2*rr)<=n):
            L.append(2*rr)
            rec(tot+(2*rr),L,n)
        else:
            if(tot+rr<=n):
                req=n-tot
                L.append(req)
                rec(tot+req,L,n)
            else:
                ele=L.pop()
                sumu=tot-ele
                while(ele==L[-1]):
                    ele=L.pop()
                    sumu-=ele
                ele-=1
                sumu+=ele
                L.append(ele)
                rec(sumu,L,n)

T=int(input())
for _ in range(0,T):
    n=int(input())
    h=[0,1]
    rec(1,h,n)


"""T=int(input())
for _ in range(0,T):
    n=int(input())
    a,b=map(int,input().split())
    s=input()
    s=[int(x) for x in input().split()]
    for i in range(0,len(s)):
        a,b=map(int,input().split())"""

"""def rec(ele,tot,L,n):
    L.append(ele)
    if(tot+ele==n):
        return L
    if(tot+(2*ele)<=n):
        rec(2*ele,tot+(2*ele),L,n)
    else:
        if(tot+ele>n):
            req=n-tot
            rec(req,L,n)
        else:
            rr=L.pop()
            rr-=1
            rec(rr,L,n)"""

"""import sys
sys.setrecursionlimit(10**8)

def rec(tot,L,n):
    rr=L[-1]
    if(tot==n):
        L=L[1:]
        print(*L)
        ans=[]
        for i in range(1,len(L)):
            ans.append(L[i]-L[i-1])
        print(len(ans))
        print(*ans)
        return
    else:
        if(tot+(2*rr)<=n):
            L.append(2*rr)
            rec(tot+(2*rr),L,n)
        else:
            if(tot+rr<=n):
                req=n-tot
                L.append(req)
                rec(tot+req,L,n)
            else:
                ele=L.pop()
                sumu=tot-ele
                while(ele==L[-1]):
                    ele=L.pop()
                    sumu-=ele
                ele-=1
                sumu+=ele
                L.append(ele)
                rec(sumu,L,n)"""

T=int(input())
for _ in range(0,T):
    n=int(input())
    L=[1]
    tot=1
    for i in range(1,50):
        L.append((1<<i))
        tot+=(1<<i)
        if(tot>=n):
            break

    ele1=L[-1]
    ele2=L[-2]

    rem=tot-n
    if(rem<=ele1//2):
        ele1-=rem
        L[-1]=ele1
    else:
        rem-=(ele1//2)
        ele1-=(ele1//2)
        req=rem//2
        if(rem%2!=0):
            ele2-=1
        ele2-=req
        ele1-=req
        L[-1]=ele1
        L[-2]=ele2
    ans=[]
    for i in range(1,len(L)):
        ans.append(L[i]-L[i-1])
    print(len(ans))
    print(*ans)

    #h=[0,1]
    #rec(1,h,n)


def solve():
    n = int(input())
    k = 1
    a = []
    while (n >= k):
        a.append(k)
        n -= k
        k *= 2
    if (n > 0):
        a.append(n)
    a.sort()
    print(len(a) - 1)
    for i in range(len(a) - 1):
        print(a[i + 1] - a[i], end=' ')
    print()

for t in range(int(input())):
    solve()


def solve():
    n = int(input())
    k = 1
    a = []
    while (n >= k):
        a.append(k)
        n -= k
        k *= 2
    if (n > 0):
        a.append(n + a[-1])
    print(len(a) - 1)
    for i in range(len(a) - 1):
        print(a[i + 1] - a[i], end=' ')
    print()
for t in range(int(input())):
    solve()


t = int(input())

for _ in range(t):
    n = int(input())
    a = []
    i = 1
    x = 0
    while x + i <= n:
        a.append(i)
        x += i
        i *= 2
    if x != n:
        a.append(n-x)
    a = sorted(a)
    days = len(a) - 1
    print(days)
    for i in range(1,len(a)):
        the_end = " "
        if i == days:
            the_end = "\n"
        print(a[i] - a[i-1], end=the_end)


import sys
sys.setrecursionlimit(10000)

class Memoize:
    def __init__(self, f):
        self.f = f
        self.memo = {}
    def __call__(self, *args):
        if not args in self.memo:
            self.memo[args] = self.f(*args)
        return self.memo[args]

class Recurse(Exception):
    def __init__(self, *args, **kwargs):
        self.args = args
        self.kwargs = kwargs

def recurse(*args, **kwargs):
    raise Recurse(*args, **kwargs)

def tail_recursive(f):
    def decorated(*args, **kwargs):
        while True:
            try:
                return f(*args, **kwargs)
            except Recurse as r:
                args = r.args
                kwargs = r.kwargs
                continue
    return decorated

t = int(input())
for _ in range(t):
    n = int(input())
    impossible = False
    days = []
    weight = 1
    bact = 1
    while weight < n:
        if weight+4*bact <= n or weight+2*bact == n:
            days.append(bact)
            bact *= 2
        else:
            need = n-weight
            if need < bact:
                impossible = True
                break
            if need-bact <= bact:
                days.append(need-bact)
                bact += need-bact
            elif need-2*bact <= bact:
                days.append((need-2*bact)//2)
                bact += (need-2*bact)//2
            else:
                days.append((need-3*bact)//3)
                bact += (need-3*bact)//3

        weight += bact
    days = list(map(str, days))
    if impossible:
        print(-1)
    else:
        print(len(days))
        print(' '.join(days))


import sys
sys.setrecursionlimit(10000)

class Memoize:
    def __init__(self, f):
        self.f = f
        self.memo = {}
    def __call__(self, *args):
        if not args in self.memo:
            self.memo[args] = self.f(*args)
        return self.memo[args]

class Recurse(Exception):
    def __init__(self, *args, **kwargs):
        self.args = args
        self.kwargs = kwargs

def recurse(*args, **kwargs):
    raise Recurse(*args, **kwargs)

def tail_recursive(f):
    def decorated(*args, **kwargs):
        while True:
            try:
                return f(*args, **kwargs)
            except Recurse as r:
                args = r.args
                kwargs = r.kwargs
                continue
    return decorated

t = int(input())
for _ in range(t):
    n = int(input())

    @Memoize
    def calc(weight, bact):
        if weight > n:
            return [-1]
        if weight == n:
            return []
        left = 0
        right = bact+1

        while left < right-1:
            split = (left+right)//2
            cost = calc(weight+bact+split, bact+split)
            if cost == [-1]:
                right = split
            else:
                left = split
        cost = calc(weight+bact+left, bact+left)
        if cost == [-1]:
            return [-1]
        else:
            return [left] + cost

    days = list(map(str, calc(1, 1)))

    if days == ["-1"]:
        print(-1)
    else:
        print(len(days))
        print(' '.join(days))


import sys
sys.setrecursionlimit(10000)

class Memoize:
    def __init__(self, f):
        self.f = f
        self.memo = {}
    def __call__(self, *args):
        if not args in self.memo:
            self.memo[args] = self.f(*args)
        return self.memo[args]

class Recurse(Exception):
    def __init__(self, *args, **kwargs):
        self.args = args
        self.kwargs = kwargs

def recurse(*args, **kwargs):
    raise Recurse(*args, **kwargs)

def tail_recursive(f):
    def decorated(*args, **kwargs):
        while True:
            try:
                return f(*args, **kwargs)
            except Recurse as r:
                args = r.args
                kwargs = r.kwargs
                continue
    return decorated

t = int(input())
for _ in range(t):
    n = int(input())

    weights = []
    total = 0
    for i in range(0, 32):
        p = 1 << i
        if total+p > n:
            break
        weights.append(p)
        total += p
    if total < n:
        weights.append(n-total)
    weights = sorted(weights)
    splits = list(map(lambda x: x[1]-x[0], zip(weights, weights[1:])))
    print(len(splits))
    print(' '.join(map(str, splits)))


import math

def solve(n):
    k = int(math.log2(n))
    t = n - (2 ** k - 1)
    l = int(math.log2(t))
    ans = []
    for i in range(k):
        if i == l:
            cur = t - 2 ** i
        elif i == l + 1:
            cur = 2 ** i - t
        elif i < l:
            cur = 2 ** i
        else:
            cur = 2 ** (i - 1)
        ans.append(cur)
    return ans

if __name__ == '__main__':
    t = int(input())
    for _ in range(t):
        n = int(input())
        ans = solve(n)
        print(len(ans))
        print(*ans, sep=' ')


import math

def solve(n):
    k = int(math.log2(n))
    t = n - (2 ** k - 1)
    l = int(math.log2(t))
    ans = []
    for i in range(k):
        if i == l:
            cur = t - 2 ** i
        elif i == l + 1:
            cur = 2 ** i - t
        else:
            cur = 2 ** i
        ans.append(cur)
    return ans

if __name__ == '__main__':
    t = int(input())
    for _ in range(t):
        n = int(input())
        ans = solve(n)
        print(len(ans))
        print(*ans, sep=' ')


import math

def solve(n):
    k = int(math.log2(n))
    t = n - (2 ** k - 1)
    l = int(math.log2(t))
    ans = []
    for i in range(k):
        if i == l:
            cur = t - 2 ** i
        elif i == l + 1:
            cur = 2 ** i - t
        else:
            cur = 2 ** (i - 1)
        ans.append(cur)
    return ans

if __name__ == '__main__':
    t = int(input())
    for _ in range(t):
        n = int(input())
        ans = solve(n)
        print(len(ans))
        print(*ans, sep=' ')


import math
for _ in range(int(input())):
	n = int(input())
	log = int(math.log2(n+1))
	nights = log - 1
	pown = 2**(nights)
	num = 1
	if 2*pown-1 == n:
		#complete division for nights
		print(nights)
		nights = log - 1

		for i in range(nights):
			print(num,end = " ")
			num *= 2
	elif n<3*pown-1:
		print(nights+1)
		k = n - (2*pown - 1)
		m = k//2
		p = k%2
		for i in range(nights-1):
			print(num,end = " ")
			num *= 2
		print(m,end = " ")
		print(p)
	else:
		print(nights+1)
		p = n - (3*pown - 1)
		for i in range(nights):
			print(num,end = " ")
			num *= 2
		print(p)


from collections import defaultdict as dc
from heapq import *
import math
import bisect
import sys
from collections import deque as dq
from heapq import heapify,heappush,heappop
mod=10**9 +7
def inp():
    p=int(input())
    return p
def line():
    p=list(map(int,input().split()))
    return p
def read_mat():
    n=inp()
    a=[]
    for i in range(n):
        a.append(line())
    return a
def digit(n):
    s=str(n)
    p=0
    for i in s:
        p+=(int(i))**2
    return p
def solve(a):
    i=1
    p=[]
    while(i<=a):
        p.append(i)
        a=a-i
        i=i*2
    if a>0:
        p.append(a)
    p.sort()
    ans=[]
    for i in range(1,len(p)):
        ans.append(p[i]-p[i-1])
    return ans

for test in range(inp()):
    a=inp()
    l=solve(a)
    print(len(l))
    print(*l)


from sys import stdin,stdout
global ans
global ans1
T=int(stdin.readline().strip())
def ceil(x):
    return x//2
    return 1+(x//2)
def f(a):
    global ans
    if a==2:
        ans.append(0)
        return
    if a==3:
        ans.append(1)
        return

    ans.append(ceil(a)-ceil(a-ceil(a)))
    f(a-ceil(a))
for caso in range(T):
    n=int(stdin.readline().strip())
    ans=[]
    f(n)
    print(len(ans))
    print(*ans[::-1])

#n,m=map(int,stdin.readline().strip().split())
#s=list(map(int,stdin.readline().strip().split()))


from sys import stdin,stdout
from math import log2
global ans
global ans1
T=int(stdin.readline().strip())
def ceil1(x):
    if x==3:
        return 2
    if x==2:
        return 1
    return ceil(x/2)
def f(a):
    global ans
    if a==2:
        ans.append(0)
        return
    if a==3:
        ans.append(1)
        return

    ans.append(ceil1(a)-ceil1(a-ceil(a)))
    f(a-ceil(a))
for caso in range(T):
    n=int(stdin.readline().strip())
    ans=[]
    f(n)
    print(len(ans))
    print(*ans[::-1])

#n,m=map(int,stdin.readline().strip().split())
#s=list(map(int,stdin.readline().strip().split()))


from sys import stdin,stdout
global ans,flag
def backtrack(x,y):
    global ans,flag
    if flag:
        return
    if x+y>n:
        return
    if x+y<=n and x+2*y>=n:
        ans.append(n-x-y)
        flag=True
        return
    for i in range(x+2*y,x+y-1,-1):
        ans.append(i-x-y)
        backtrack(i,i-x)
        if flag:
            return
        ans.pop()
        flag=True
        return

    return
"""
r=[-1 for i in range(520)]
r1=[-1 for i in range(520)]
r[2]=1
r[3]=1
arr=[[2,1],[3,2]]
while arr[0][0]<100:
    for i in range(arr[0][0]+arr[0][1],arr[0][0]+2*arr[0][1]+1):
        if r[i]==-1:
            r[i]=arr[0][0]
            r1[i]=i-arr[0][0]+arr[0][1]
            arr.append([i,arr[0][1]+r1[i]])
    arr=arr[1::]
    arr.sort()
"""
T=int(stdin.readline().strip())
for caso in range(T):
    n=int(stdin.readline().strip())
    flag=False
    ans=[]
    backtrack(1,1)
    x=(2**(len(ans)+1))-1
    y=2**len(ans)
    z=(n-x-2*y)//2
    if z>=0:

        ans.append(z)
        ans.append((n+1)%2)
    print(len(ans))
    print(*ans)

#n,m=map(int,stdin.readline().strip().split())
#s=list(map(int,stdin.readline().strip().split()))


from sys import stdin,stdout
global ans,flag
def backtrack(x,y):
    global ans,flag
    if flag:
        return
    if x+y>n:
        return
    if x+y<=n and x+2*y>=n:
        ans.append(n-x-y)
        flag=True
        return
    for i in range(x+2*y,x+y-1,-1):
        ans.append(i-x-y)
        backtrack(i,i-x)
        if flag:
            break
        ans.pop()
    return
"""
r=[-1 for i in range(520)]
r1=[-1 for i in range(520)]
r[2]=1
r[3]=1
arr=[[2,1],[3,2]]
while arr[0][0]<100:
    for i in range(arr[0][0]+arr[0][1],arr[0][0]+2*arr[0][1]+1):
        if r[i]==-1:
            r[i]=arr[0][0]
            r1[i]=i-arr[0][0]+arr[0][1]
            arr.append([i,arr[0][1]+r1[i]])
    arr=arr[1::]
    arr.sort()
"""
T=int(stdin.readline().strip())
for caso in range(T):
    n=int(stdin.readline().strip())
    flag=False
    ans=[]
    backtrack(1,1)
    print(len(ans))
    print(*ans)

#n,m=map(int,stdin.readline().strip().split())
#s=list(map(int,stdin.readline().strip().split()))


from math import floor

T = int(input())
for _ in range(T):
    N = int(input())
    r = N-1
    b = 1
    steps = []
    while r > 0:
        if b <= r <= b*2:
            splits = r-b
            b = r
            steps += str(splits),
            r -= b
        else:
            splits = min(b*2,floor(r/2)) - b
            b += splits
            steps += str(splits),
            r -= b
    print(len(steps))
    print(" ".join(steps))


def reproduction(time,population,weight):
    if (weight<time*population):
        return -1
    weight_add=weight-time*population
    k = weight_add // time
    if k>population:
        return population
    else:
        return k

t=int(input())
for i in range(t):
    n=int(input())
    k=0
    while 2**(k+1)-1<n:
        k+=1
    print(k)
    population=1
    r=k
    n-=1
    for j in range(k):
        l=reproduction(r,population,n)
        #print('step ',j,' ',r,' ' ,population,' ',n)
        print(l,end=' ')
        population+=l
        n-=population
        r-=1
    print()


for t in range(int(input())):
    n=int(input())
    l=[]
    i=1
    while(i<n+1):
        l.append(i)
        n=n-i
        i=i*2
    if(n>0):
        l.append(n)
        l.sort()
    print(len(l)-1)
    for i in range(1,len(l)):
        print(l[i]-l[i-1],end=' ')
    print()


import math
t=int(input())
for i in range(t):
    n=int(input())
    l=[]
    i=1
    while(i<n+1):
        l.append(i)
        n=n-i
        i=i*2
    print(len(l))
    if(n>0):
        l.append(n)
    l.sort()
    for i in range(1,len(l)):
        print(l[i]-l[i-1],end=" ")
    print()


import math
o=int(input())
for o in range(t):
    n=int(input())
    l=[]
    i=1
    while(i<n+1):
        l.append(i)
        n=n-i
        i=i*2
    print(len(l))
    if(n>0):
        l.append(n)
    l.sort()
    for i in range(1,len(l)):
        print(l[i]-l[i-1]),end=" ")
    print()


import math
o=int(input())
for o in range(t):
    n=int(input())
    l=[]
    i=1
    while(i<n+1):
        l.append(i)
        n=n-i
        i=i*2
    print(len(l))
    if(n>0):
        l.append(n)
    l.sort()
    for i in range(1,len(l)):
        print(l[i]-l[i-1],end=" ")
    print()


import math
t=int(input())
for i in range(t):
    n=int(input())
    l=[]
    i=1
    while(i<n+1):
        l.append(i)
        n=n-i
        i=i*2
    print(len(l))
    if(n>0):
        l.append(n)
        l.sort()
    for i in range(1,len(l)):
        print(l[i]-l[i-1],end=" ")
    print()


t = int(input())
for test_case in range(t):
    n = int(input())
    b = 1
    ans = []
    n -= 1
    while n > 0:
        if 4*b < n:
            ans.append(b)
            b *= 2
            n -= b
        elif 2 * b < n:
            ans.append((n-2*b)//2)
            ans.append((2-2*b)%2)
            n = 0
        else:
            ans.append(n-b)
            n = 0
    print(len(ans))
    print(*ans)


t = int(input())
for test_case in range(t):
    n = int(input())
    b = 1
    ans = []
    n -= 1
    while n > 0:
        if 4*b < n:
            ans.append(b)
            b *= 2
            n -= b
        elif 2 * b < n:
            ans.append((n-2*b)//2)
            ans.append((n-2*b)%2)
            n = 0
        else:
            ans.append(n-b)
            n = 0
    print(len(ans))
    print(*ans)


n = int(input())
while n>0:
    n=n-1
    l = []
    s = 0
    m = int(input())
    i = 1
    while i<=m:
        if s+i<=m:
            s+=i
            l.append(i)
        i*=2
    if s<m:
        l.append(m-s)
    l1 = sorted(l)

    print(len(l1)-1)
    for j in range(1,len(l1)):
        print(l1[j]-l1[j-1],end = "")
    print()


n = int(input())
while n>0:
    n=n-1
    l = []
    s = 0
    m = int(input())
    i = 1
    while i<=m:
        if s+i<=m:
            s+=i
            l.append(i)
        i*=2
    if s<m:
        l.append(m-s)
    l1 = sorted(l)

    print(len(l1)-1)
    for j in range(1,len(l1)):
        print(l1[j]-l1[j-1],end = " ")
    print()


def solve n
  arr = []
  (0..50).each do |i|
    arr << (2 ** i)
    break if arr.reduce(:+) >= n
  end
  rem = arr.reduce(:+) - n
  idx = arr.length - 1
  idx.downto(1).each do |i|
    break if rem == 0
    if arr[i] - rem < arr[i - 1]
      rem -= (arr[i] - arr[i - 1])
      arr[i] = arr[i - 1]
    else
      arr[i] -= rem
      rem = 0
    end
  end
  res = []
  (1...arr.length).each do |i|
    res << 0 if arr[i] == arr[i - 1]
    if arr[i] > arr[i - 1]
      if arr[i] == arr[i - 1] * 2
        res << arr[i - 1]
      else
        res << arr[i] % arr[i - 1]
      end
    end
  end
  res
end

t = STDIN.gets.chomp.to_i

(1..t).each do |i|
  n = STDIN.gets.chomp.to_i
  res = solve n
  puts res.length
  puts res.join(" ")
end


for _ in "."*input():
	n = input()
	i,l = 1,[]
	while i<=n:
		n -= i
		l.append(i)
		i *= 2
	if n:
		l.append(n)
	l.sort()
	print len(l) - 1
	for i in range(1,len(l)):
		print l[i] - l[i-1],
	print


def go(n, c, g, k):
    if k:
        t = min(c, (n - g - k * c) / k)
        a.append(t)
        go(n, c + t, g + c + t, k - 1)

T = int(raw_input())
for _ in xrange(T):
    n = int(raw_input())
    k = n.bit_length() - 1
    print k
    a = []
    go(n, 1, 1, k)
    for x in a:
        print x,
    print


N = 64
def solve(n):
    res = []
    cur = 1
    while n > 0:
        # print n, cur
        n -= cur
        if n <= cur * 2:
            res.append(n - cur)
            n = 0
        elif n <= cur * 4:
            res.append(n / 2 - cur)
            cur += n / 2 - cur
        else:
            res.append(cur)
            cur *= 2
    # print res
    assert n == 0
    return res

def test(n):
    res = solve(n)
    assert min(res) >= 0
    mass = 1
    tot = 1
    for num in res:
        if num == 0:
            tot += mass
        else:
            mass += num
            tot += mass
    assert tot == n

test(10)
test(12)
test(5)
test(11)
test(4)

for i in xrange(2, 100):
    test(i)

test(10 ** 9)

T = int(raw_input())
for case_ in xrange(T):
    n = int(raw_input())
    res = solve(n)
    print len(res)
    print ' '.join(map(str, res))


N = 2000
def solve(n):
    want = n
    mass = 1
    tot = 1
    res = []
    pre = 1
    for i in xrange(N):
        cnt = 1
        if (n & (1 << i)) == 0:
            n -= (1 << i)
            cnt = 2
        if i != 0:
            res.append(mass)
            mass *= 2
            tot += mass
        if cnt == 2:
            res.append(0)
            tot += mass
        pre = cnt
        if tot == want:
            break
    return res

def test(n):
    res = solve(n)
    mass = 1
    tot = 1
    # print res
    for num in res:
        if num == 0:
            tot += mass
        else:
            mass += num
            tot += mass
    assert tot == n

test(12)
test(10)
test(5)
test(11)
test(4)

for i in xrange(2, 100):
    test(i)

test(10 ** 9)

T = int(raw_input())
for case_ in xrange(T):
    n = int(raw_input())
    res = solve(n)
    print len(res)
    print ' '.join(map(str, res))


N = 10
def solve(n):
    want = n
    mass = 1
    tot = 1
    res = []
    pre = 1
    for i in xrange(N):
        cnt = 1
        if (n & (1 << i)) == 0:
            n -= (1 << i)
            cnt = 2
        if i != 0:
            res.append(mass)
            mass *= 2
            tot += mass
        if cnt == 2:
            res.append(0)
            tot += mass
        pre = cnt
        if tot == want:
            break
    return res

def test(n):
    res = solve(n)
    mass = 1
    tot = 1
    # print res
    for num in res:
        if num == 0:
            tot += mass
        else:
            mass += num
            tot += mass
    assert tot == n

T = int(raw_input())
for case_ in xrange(T):
    n = int(raw_input())
    res = solve(n)
    print len(res)
    print ' '.join(map(str, res))


for _ in range(input()):
	n = input()
	i = 1
	l = []
	while i <= n:
		n -= i
		l.append(i)
		i *= 2
	if n:
		l.append(n)
	l.sort()
	print len(l) - 1
	for i in range(1, len(l)):
		print l[i] - l[i-1],
	print


t = int(raw_input())
for _ in range(t):
    target = int(raw_input())
    step = 1
    sum = 1
    ans = []
    while True:
        diff = target - sum
        if diff >= 6 * step:
            ans.append(step)
            step += step
            sum += step
        elif diff <= 2 * step:
            step = diff - step
            ans.append(step)
            break
        else:
            half = diff // 2
            step = half - step
            ans.append(step)
            step = diff % 2
            ans.append(step)
            break
    print (len(ans))
    print (' '.join(map(str, ans)))


t = int(raw_input())
for _ in range(t):
    target = int(raw_input())
    step = 1
    sum = 1
    ans = []
    while True:
        diff = target - sum
        if diff >= 6 * step:
            ans.append(step)
            step += step
            sum += step
        elif diff <= 2 * step:
            step = diff - step
            ans.append(step)
            break
        else:
            half = diff // 2
            added = min(half - step, step)
            ans.append(added)
            step += added
            sum += step
            diff = target - sum
            added = diff - step
            ans.append(added)
            break
    print (len(ans))
    print (' '.join(map(str, ans)))


#include<stdio.h>
int main()
{
	int t;
	scanf("%d",&t);
	long long int n;
	long long int m,cnt;
	long long int d,ans[1003];
	long long int i;
	for(;t>0;t--)
	{
		scanf("%lld",&n);
		cnt=m=1;
		d=0;
		for(;m<n;)
		{
			if(m+4*cnt<n)
			{
				ans[d]=cnt;
				d++;
				cnt*=2;
				m+=cnt;
			}
			else if(n<=2*cnt+m)
			{
				ans[d]=n-m-cnt;
				cnt+=ans[d];
				d++;
				m+=cnt;
			}
			else
			{
				ans[d]=(n-m)/2-cnt;
				cnt+=ans[d];
				d++;
				m+=cnt;
			}
		}
		printf("%lld\n",d);
		for(i=0;i<d;i++)
		{
			printf("%lld",ans[i]);
			if(i<d-1)
				printf(" ");
			else
				printf("\n");
		}
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>

long long int binarySearch(long long int alfa, long long int total, long long int aux, long long int n)
{
	long long int l = 0;
	long long int r = alfa;
	while ( l <= r )
	{
		long long int m = (l + r)/2;

		if( total + m*aux <= n && total +(m+1)*aux > n )
		{
			return m;
		}

		if ( total + m*aux < n )
		{
			l = m+1;
		}

		if ( total + m*aux > n )
		{
			r = m-1;
		}

	}
}

int main()
{
	long long int t;
	scanf("%lld", &t);
	long long int i;
	long long int exp[31];
	for ( i = 0; i < 31; ++i )
	{
		exp[i] = pow(2,i);
	}
	/*
	for ( i = 0; i < 31; ++i )
	{
		printf("%lld ", exp[i] );
	}
	printf("\n");
	*/
	do
	{
		long long int n;
		scanf("%lld", &n);
		long long int day = 0;
		long long int total = 0;
		do
		{
			total = 1+day;
			long long int aux =day;
			for ( i = 0; i < day; ++i )
			{
				total += aux*exp[i];
				--aux;
			}
			++day;
		} while ( total < n );
		day -= 1;
		printf("%lld\n", day);
		long long int sol[day];
		for ( i = 0; i < day; ++i )
		{
			sol[i] = 0;
		}
		total = day+1;
		long long int aux = day;
		long long int index =0;
		long long int nd = 1;
		for ( i = 0; i < 31; ++i )
		{

			if ( total + aux*exp[i] <= n )
			{
				total += aux*exp[i];
				sol[index] = exp[i];
				nd += exp[i];
				++index;
				aux -= 1;
				if ( total == n )
				{
					break;
				}
			}
			else
			{
				//printf("hola total %lld nd %lld aux %lld n %lld\n", total, nd, aux, n);
				long long int alfa = binarySearch(nd, total,aux,n);
				//printf("chao alfa %lld\n", alfa);
			//	printf("alfa es %lld\n", alfa);
				/*
				do
				{
					long long int mid
					//printf("total es %lld\n", total+aux*alfa);
				} while ( total + aux*alfa > n && alfa > 0);
				//printf("alfa after es %lld\n", alfa);
				*/

				sol[index] = alfa;
				nd += alfa;
				++index;
				total += aux*alfa;
				aux -= 1;
				if ( total == n )
				{
					break;
				}
			}
			//printf("total2 es %lld\n", total);
		}

		for ( i = 0; i < day; ++i )
		{
			printf("%lld ", sol[i]);
		}
		printf("\n");

		--t;
	} while ( t != 0 );
//	system("pause");
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
	long long int t;
	scanf("%lld", &t);
	long long int i;
	long long int exp[31];
	for ( i = 0; i < 31; ++i )
	{
		exp[i] = pow(2,i);
	}
	/*
	for ( i = 0; i < 31; ++i )
	{
		printf("%lld ", exp[i] );
	}
	printf("\n");
	*/
	do
	{
		long long int n;
		scanf("%lld", &n);
		long long int day = 0;
		long long int total = 0;
		do
		{
			total = 1+day;
			long long int aux =day;
			for ( i = 0; i < day; ++i )
			{
				total += aux*exp[i];
				--aux;
			}
			++day;
		} while ( total < n );
		day -= 1;
		printf("%lld\n", day);
		long long int sol[day];
		for ( i = 0; i < day; ++i )
		{
			sol[i] = 0;
		}
		total = day+1;
		long long int aux = day;
		long long int index =0;
		long long int nd = 1;
		for ( i = 0; i < 31; ++i )
		{

			if ( total + aux*exp[i] <= n )
			{
				total += aux*exp[i];
				sol[index] = exp[i];
				nd += exp[i];
				++index;
				aux -= 1;
				if ( total == n )
				{
					break;
				}
			}
			else
			{
				long long int alfa = nd;
			//	printf("alfa es %lld\n", alfa);
				do
				{
					--alfa;
					//printf("total es %lld\n", total+aux*alfa);
				} while ( total + aux*alfa > n && alfa > 0);
				//printf("alfa after es %lld\n", alfa);
				sol[index] = alfa;
				nd += alfa;
				++index;
				total += aux*alfa;
				aux -= 1;
				if ( total == n )
				{
					break;
				}
			}
			//printf("total2 es %lld\n", total);
		}

		for ( i = 0; i < day; ++i )
		{
			printf("%lld ", sol[i]);
		}
		printf("\n");

		--t;
	} while ( t != 0 );
	//system("pause");
}


//思路：贪心找规律
//第 n 天细菌质量数在 [ n+1, 2^(n+1)-1 ] 内任何一个数 (左区间始终不分裂 右区间一直分裂)
//所以最快的时间d满足2^(d+1)-1>=m  d = log(m+1) - 1, log以2为底
//确定时间为d后 设k个细菌在第 i 天分裂 会导致最终质量增加 k*(d-i+1)
//设某天白天细菌有X个 则当天新增质量M满足 X <= M <= 2*X
//本题实际上不存在无解情况 因为一直不分裂则细菌的质量每次+1 总会到达n
//本质上本题也可以通过二进制叠加 任何一个数都可以这样表示出来
#include<stdio.h>
#include<stdlib.h>
int mypow( int base, int p )
{
	int ans=1;
	while( p>0 ){
		ans *= base;
		p--;
	}
	return ans;
}
int min( int a, int b )
{
	return a>b ? b : a;
}
int main()
{
	int t, n, d, count, nextCnt;
	scanf("%d", &t);
	while( t>0 ){
		t--; d=1; //最少为1天
		scanf("%d", &n);
		while( mypow( 2, d+1 )-1 < n )
			d++;
		printf("%d\n", d);
		count = 1; //当前细菌的个数
		for(int i=1; i<=d; i++){
			n -= count; //还要增加的质量
			nextCnt = min( n/(d-i+1), 2*count ); //下一天细菌个数
			printf("%d ", nextCnt - count);
			count = nextCnt;
		}
		printf("\n");
	}
	//system("pause");
	return 0;
}


#include <stdio.h>

int min(int a, int b) { return a < b ? a : b; }

int main() {
	int t;

	scanf("%d", &t);
	while (t--) {
		int n, l, k, h;

		scanf("%d", &n);
		l = 0;
		while (1 << (l + 1) <= n)
			l++;
		printf("%d\n", l);
		k = 1;
		for (h = 0; h < l; h++) {
			int k_;

			n -= k;
			k_ = min(n / (l - h), k * 2);
			printf("%d ", k_ - k);
			k = k_;
		}
		printf("\n");
	}
	return 0;
}


#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>

#define scd(t) scanf("%d",&t)
#define scld(t) scanf("%ld",&t)
#define sclld(t) scanf("%lld",&t)
#define scc(t) scanf("%c",&t)
#define scs(t) scanf("%s",t)
#define scf(t) scanf("%f",&t)
#define prd(t) printf("%d",t)
#define prld(t) printf("%ld",t)
#define prlld(t) printf("%lld",t)
#define prc(t) printf("%c",t)
#define prs(t) printf("%s",t)
#define prf(t) printf("%f",t)
#define prsp() printf(" ")
#define prnl() printf("\n")
#define MOD 1000000007
#define MAX(a,b) a>b?a:b
#define MIN(a,b) a<b?a:b
#define fo(i,a,b) for(int i=a;i<b;i++)

// Merges two subarrays of arr[].
// First subarray is arr[l..m]
// Second subarray is arr[m+1..r]
void merge(int arr[], int l, int m, int r)
{
    int i, j, k;
    int n1 = m - l + 1;
    int n2 =  r - m;

    /* create temp arrays */
    int L[n1], R[n2];

    /* Copy data to temp arrays L[] and R[] */
    for (i = 0; i < n1; i++)
        L[i] = arr[l + i];
    for (j = 0; j < n2; j++)
        R[j] = arr[m + 1+ j];

    /* Merge the temp arrays back into arr[l..r]*/
    i = 0; // Initial index of first subarray
    j = 0; // Initial index of second subarray
    k = l; // Initial index of merged subarray
    while (i < n1 && j < n2)
    {
        if (L[i] <= R[j])
        {
            arr[k] = L[i];
            i++;
        }
        else
        {
            arr[k] = R[j];
            j++;
        }
        k++;
    }

    /* Copy the remaining elements of L[], if there
       are any */
    while (i < n1)
    {
        arr[k] = L[i];
        i++;
        k++;
    }

    /* Copy the remaining elements of R[], if there
       are any */
    while (j < n2)
    {
        arr[k] = R[j];
        j++;
        k++;
    }
}

/* l is for left index and r is right index of the
   sub-array of arr to be sorted */
void mergeSort(int arr[], int l, int r)
{
    if (l < r)
    {
        // Same as (l+r)/2, but avoids overflow for
        // large l and h
        int m = l+(r-l)/2;

        // Sort first and second halves
        mergeSort(arr, l, m);
        mergeSort(arr, m+1, r);

        merge(arr, l, m, r);
    }
}

void solve(){
	int n;
	scd(n);
	int a[100];
	int y=0;
	for (int i=1;i<=n;i*=2){
        a[y++]=i;
        n-=i;
    }
    if(n>0){
    	a[y]=n;
        mergeSort(a,0,y);

	prd(y);
	prnl();
	for(int l=1;l<=y;l++)
		printf("%d ",a[l]-a[l-1]);
    }
    else{
    	y--;
    	prd(y);
	    prnl();
	    for(int l=1;l<=y;l++)
	    	printf("%d ",a[l]-a[l-1]);
    }
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
	int t; scd(t);
	while(t--){
		solve();
		prnl();
	}
	return 0;
}


#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>

#define scd(t) scanf("%d",&t)
#define scld(t) scanf("%ld",&t)
#define sclld(t) scanf("%lld",&t)
#define scc(t) scanf("%c",&t)
#define scs(t) scanf("%s",t)
#define scf(t) scanf("%f",&t)
#define prd(t) printf("%d",t)
#define prld(t) printf("%ld",t)
#define prlld(t) printf("%lld",t)
#define prc(t) printf("%c",t)
#define prs(t) printf("%s",t)
#define prf(t) printf("%f",t)
#define prsp() printf(" ")
#define prnl() printf("\n")
#define MOD 1000000007
#define MAX(a,b) a>b?a:b
#define MIN(a,b) a<b?a:b
#define fo(i,a,b) for(int i=a;i<b;i++)

// Merges two subarrays of arr[].
// First subarray is arr[l..m]
// Second subarray is arr[m+1..r]
void merge(int arr[], int l, int m, int r)
{
    int i, j, k;
    int n1 = m - l + 1;
    int n2 =  r - m;

    /* create temp arrays */
    int L[n1], R[n2];

    /* Copy data to temp arrays L[] and R[] */
    for (i = 0; i < n1; i++)
        L[i] = arr[l + i];
    for (j = 0; j < n2; j++)
        R[j] = arr[m + 1+ j];

    /* Merge the temp arrays back into arr[l..r]*/
    i = 0; // Initial index of first subarray
    j = 0; // Initial index of second subarray
    k = l; // Initial index of merged subarray
    while (i < n1 && j < n2)
    {
        if (L[i] <= R[j])
        {
            arr[k] = L[i];
            i++;
        }
        else
        {
            arr[k] = R[j];
            j++;
        }
        k++;
    }

    /* Copy the remaining elements of L[], if there
       are any */
    while (i < n1)
    {
        arr[k] = L[i];
        i++;
        k++;
    }

    /* Copy the remaining elements of R[], if there
       are any */
    while (j < n2)
    {
        arr[k] = R[j];
        j++;
        k++;
    }
}

/* l is for left index and r is right index of the
   sub-array of arr to be sorted */
void mergeSort(int arr[], int l, int r)
{
    if (l < r)
    {
        // Same as (l+r)/2, but avoids overflow for
        // large l and h
        int m = l+(r-l)/2;

        // Sort first and second halves
        mergeSort(arr, l, m);
        mergeSort(arr, m+1, r);

        merge(arr, l, m, r);
    }
}

void solve(){
	int n;
	scd(n);
	int a[100];
	int y=0;
	for (int i=1;i<=n;i*=2){
        a[y++]=i;
        n-=i;
    }
    if(n>0){
    	a[y]=n;
        mergeSort(a,0,y);
    }
	prd(y);
	prnl();
	for(int l=1;l<=y;l++)
		printf("%d ",a[l]-a[l-1]);
}

int main(){
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
	int t; scd(t);
	while(t--){
		solve();
		prnl();
	}
	return 0;
}


#include<stdio.h>
int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int num;
        int arr[1000000];
        scanf("%d",&num);
        int massbact = 1;
        int rate = 1;
        int count=0;
        while (1){
            if (num-massbact >= 4*rate){
                arr[count++] = rate;
                rate *= 2;
                massbact += rate;
;           }
            else if(num-massbact <= 2*rate ){
                arr[count++] = (num-massbact)-rate;
                break;
            }
            else{
                arr[count++] = (num-massbact)/2 -rate;
                rate =(num-massbact)/2;
                massbact += rate;
            }
        }
        printf("%d\n",count);
        for (int i=0; i<count; i++){
            printf("%d ",arr[i]);
        }
        printf("\n");
    }
}


#include<stdio.h>
int main(){
    int t;
    scanf("%d",&t);
    while(t--){
        int num;
        int arr[1000000];
        scanf("%d",&num);
        int massbact = 1;
        int rate = 1;
        int count=0;
        while (1){
            if (num-massbact >= 4*rate){
                arr[count++] = rate;
                rate *= 2;
                massbact += rate;
;           }
            else if(num-massbact <= 2*rate ){
                arr[count++] = (num-massbact)-rate;
                break;
            }
            else{
                arr[count++] = 0;
                massbact += rate;
            }
        }
        printf("%d\n",count);
        for (int i=0; i<count; i++){
            printf("%d ",arr[i]);
        }
        printf("\n");
    }
}


'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.trim();
    });

    main();
});

function readline() {
    return inputString[currentLine++];
}
/**
    3
    9
    11
    2
**/

function main() {
    var range = readline();

    for(var r=0;r<range;r++) {
        let total = parseInt(readline());
        const b = [];
        const diff = [];
        let N = total;
        let i = 1;

        for(i=1;i<=total;i=i*2) {
            b.push(i);
            total = total - i;
        }

        if(total > 0) {
             b.push(total);
             b.sort((x,y) => x-y);
        }

        for(let i=1;i<b.length;i++) {
              diff.push(b[i] - b[i-1]);
        }

        console.log(diff.length);
        console.log(diff.join(" "));
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Hacking
{
    public class Algo
    {
        private StreamWriter _w;
        private StreamReader _r;

        public Algo(StreamReader r, StreamWriter w)
        {
            _w = w;
            _r = r;
        }

        public void Run()
        {
            int count = _r.ReadNum();

            for (int i = 1; i <= count; i++)
            {
                Solve();
            }
        }

        private void Solve()
        {
            int n = _r.ReadNum();

            List<int> pp = new List<int>();
            int s = 1;
            while (n >= s)
            {
                pp.Add(s);
                n -= s;
                s *= 2;
            }
            if (n != 0)
            {
                pp.Add(n);
                pp.Sort();
            }

            int days = pp.Count - 1;
            var splits = new int[days];
            for (int i = 0; i < days; i++)
            {
                splits[i] = pp[i + 1] - pp[i];
            }

            _w.WriteLine(days);
            _w.WriteNums(splits);
        }
    }

    public static class Program
    {
        public static void Main(string[] args)
        {
#if !ONLINE_JUDGE
            string input = @"3
9
11
2";

            string expectedOutput = @"3
1 0 2
3
1 1 2
1
0";
#endif

            var f = new Factory();
#if !ONLINE_JUDGE
            f.InputContent = input;
#endif

            var r = f.GetReader();
            var w = f.GetWriter();
            Algo p = new Algo(r, w);
            p.Run();
            w.Flush();

#if !ONLINE_JUDGE
            string result = f.GetOutputContent();
            var resultLines = result.Split(new[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);
            var outputLines = expectedOutput.Split(new[] { "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries);

            for (int i = 0; i < outputLines.Length; i++)
            {
                if (!string.Equals(outputLines[i].Trim(), resultLines[i].Trim()))
                {
                    throw new InvalidOperationException($"Line {i + 1}: \"{resultLines[i]}\" instead of \"{outputLines[i]}\".");
                }
            }
#endif
        }
    }

    public static class ReaderExtensions
    {
        public static int[] ReadNums(this StreamReader r)
        {
            string[] data = r.ReadLine().Split(' ');
            int[] ret = new int[data.Length];
            for (int i = 0; i < data.Length; i++)
                ret[i] = int.Parse(data[i]);

            return ret;
        }

        public static void ReadNums(this StreamReader r, out int a, out int b)
        {
            string[] data = r.ReadLine().Split(' ');
            a = int.Parse(data[0]);
            b = int.Parse(data[1]);
        }

        public static void ReadNums(this StreamReader r, out int a, out int b, out int c)
        {
            string[] data = r.ReadLine().Split(' ');
            a = int.Parse(data[0]);
            b = int.Parse(data[1]);
            c = int.Parse(data[2]);
        }

        public static Int16[] ReadShorts(this StreamReader r)
        {
            string[] data = r.ReadLine().Split(' ');
            Int16[] ret = new Int16[data.Length];
            for (int i = 0; i < data.Length; i++)
                ret[i] = Int16.Parse(data[i]);

            return ret;
        }

        public static long[] ReadLongs(this StreamReader r)
        {
            string[] data = r.ReadLine().Split(' ');
            long[] ret = new long[data.Length];
            for (long i = 0; i < data.Length; i++)
                ret[i] = long.Parse(data[i]);

            return ret;
        }

        public static int ReadNum(this StreamReader r)
        {
            return int.Parse(r.ReadLine());
        }

        public static long ReadLong(this StreamReader r)
        {
            return long.Parse(r.ReadLine());
        }

        public static void WriteLine(this StreamWriter w, int i)
        {
            w.WriteLine(i.ToString());
        }

        public static void WriteLine(this StreamWriter w, char[] z)
        {
            w.WriteLine(new string(z));
        }

        public static void WriteNums(this StreamWriter w, IEnumerable<int> nn)
        {
            bool first = true;
            foreach (int n in nn)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    w.Write(' ');
                }
                w.Write(n);
            }
            w.WriteLine();
        }
    }

    public class Factory
    {
        private StreamWriter _sw;
        private StreamReader _sr;
#if !ONLINE_JUDGE
        public string InputContent { get; set; }
        private MemoryStream _ms;

        public string GetOutputContent()
        {
            return Encoding.ASCII.GetString(_ms.ToArray());
        }
#endif

        public StreamWriter GetWriter()
        {
            return _sw = _sw ?? new StreamWriter(GetOutputStream());
        }

        Stream GetOutputStream()
        {
#if ONLINE_JUDGE
            return Console.OpenStandardOutput();
#else
            return _ms = new MemoryStream();
#endif
        }

        public StreamReader GetReader()
        {
            return _sr = _sr ?? new StreamReader(GetInputStream());
        }

        Stream GetInputStream()
        {
#if ONLINE_JUDGE
            return Console.OpenStandardInput();
#else
            return new MemoryStream(Encoding.ASCII.GetBytes(InputContent), false);
#endif
        }

        public void Dispose()
        {
            _sw?.Dispose();
            _sr?.Dispose();
        }
    }
}


using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using static System.Math;
using static System.Numerics.BigInteger;
using static Program.IO.Scanner;

using Number = System.Int64;
#region IO
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}
	static public class Scanner {
		public static StreamScanner sc = new StreamScanner(Console.OpenStandardInput());
		public static int ri => sc.Integer();
		public static long rl => sc.Long();
		public static string rs => sc.Scan();
		public static double rd => sc.Double();
	}
	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}

}

#endregion

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}

	static public void Main() {
		Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		var t = new System.Threading.Thread(solver.Solve, 30000000);
		t.Start();
		t.Join();
		//*/
		//solver.Solve();
		Console.Out.Flush();
	}
}
#endregion

namespace Program {
	public class Solver {
		Random rnd = new Random(0);
		public void Solve() {
			var T = ri;
			for (int _ = 0; _ < T; _++) {
				solve();

			}
		}
		void solve() {
			var n = rl;
			var k = 1;
			while ((1L << k) - 1 < n) k++;
			k--;
			//i 日目に増やした分
			var ans = new long[k + 1];
			//i 日目に増やしたときの寄与
			var coef = new long[k + 1];
			for (int i = 0; i <= k; i++)
				coef[i] = k - i + 1;
			ans[0] = 1;
			n -= coef[0] * ans[0];
			var total = 1L;
			for (int i = 1; i <= k; i++) {
				var max = total;
				var mi = Min(max, n / coef[i]);
				ans[i] = mi;
				total += mi;
				n -= coef[i] * mi;
			}
			Console.WriteLine(ans.Skip(1).AsJoinedString());
		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n]; for (int i = 0; i < a.Length; ++i) a[i] = f(i); return a;
		}
		static T[][] Enumerate<T>(int n, int m, Func<int, int, T> f) {
			return Enumerate(n, x => Enumerate(m, y => f(x, y)));
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}


using System;
using System.Linq;
using System.Collections.Generic;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using static System.Math;
using static System.Numerics.BigInteger;
using static Program.IO.Scanner;

using Number = System.Int64;
#region IO
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}
	static public class Scanner {
		public static StreamScanner sc = new StreamScanner(Console.OpenStandardInput());
		public static int ri => sc.Integer();
		public static long rl => sc.Long();
		public static string rs => sc.Scan();
		public static double rd => sc.Double();
	}
	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}

}

#endregion

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}

	static public void Main() {
		Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		var t = new System.Threading.Thread(solver.Solve, 30000000);
		t.Start();
		t.Join();
		//*/
		//solver.Solve();
		Console.Out.Flush();
	}
}
#endregion

namespace Program {
	public class Solver {
		Random rnd = new Random(0);
		public void Solve() {
			var T = ri;
			for (int _ = 0; _ < T; _++) {
				solve();

			}
		}
		void solve() {
			var n = rl;
			var k = 1;
			while ((1L << k) - 1 < n) k++;
			k--;
			//i 日目に増やした分
			var ans = new long[k + 1];
			//i 日目に増やしたときの寄与
			var coef = new long[k + 1];
			for (int i = 0; i <= k; i++)
				coef[i] = k - i + 1;
			ans[0] = 1;
			n -= coef[0] * ans[0];
			var total = 1L;
			for (int i = 1; i <= k; i++) {
				var max = total;
				var mi = Min(max, n / coef[i]);
				ans[i] = mi;
				total += mi;
				n -= coef[i] * mi;
			}
			Console.WriteLine(k);
			Console.WriteLine(ans.Skip(1).AsJoinedString());
		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n]; for (int i = 0; i < a.Length; ++i) a[i] = f(i); return a;
		}
		static T[][] Enumerate<T>(int n, int m, Func<int, int, T> f) {
			return Enumerate(n, x => Enumerate(m, y => f(x, y)));
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();

        int t = sc.NextInt();
        var sb = new StringBuilder();
        for (int i = 0; i < t; i++)
        {
            sb.AppendLine(Q(sc.NextInt()));
        }
        Console.Write(sb);
    }

    string Q(long n)
    {
        long cnt = 1;
        long sum = 1;
        bool f = true;
        var l = new List<long>();
        while (sum < n)
        {
            // 増やさない cnt増える
            // 増やす i増やす 0 <= i <= cnt
            // cnt + i増える
            long d = n - sum;

            // 増やす
            if (cnt <= d && d <= cnt * 2)
            {
                l.Add(d - cnt);
                cnt = d;
            }
            else if (d > (cnt * 2) * 2)
            {
                l.Add(cnt);
                cnt += cnt;
            }
            else
            {
                // cnt*2 < d <= cnt*2*2
                l.Add(d / 2 - cnt);
                cnt += d / 2 - cnt;
                sum += cnt;
                if (d % 2 == 1)
                {
                    l.Add(1);
                    cnt++;
                }
                else
                {
                    l.Add(0);
                }
            }
            sum += cnt;
        }
        return $"{l.Count}\n{string.Join(" ", l)}";
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();

        int t = sc.NextInt();
        var sb = new StringBuilder();
        for (int i = 0; i < t; i++)
        {
            sb.AppendLine(Q(sc.NextInt()));
        }
        Console.Write(sb);
    }

    string Q(long n)
    {
        // 分裂する
        // 2^1以上の連続する2べきの和で表す
        var l = new long[31];
        l[0] = n - 1;
        for (int i = 0; i < 30; i++)
        {
            if (l[i] == 0) break;
            if (l[i] % 2 == 1)
            {
                l[i + 1] += l[i] / 2;
                l[i] %= 2;
            }
            else
            {
                if (i > 0)
                {
                    l[i + 1] += (l[i] - 2) / 2;
                    l[i] = 2;
                }
                else
                {
                    l[i + 1] += l[i] / 2;
                    l[0] = 0;
                }
            }
        }
        var ans = new List<long>();

        for(int i = 0; i < 31; i++)
        {
            if (i > 0 && l[i] == 0) break;
            if(i == 0)
            {
                for (int j = 0; j < l[0]; j++) ans.Add(0);
            }
            else
            {
                ans.Add((1 << (i - 1)));
                for (int j = 0; j < l[i] -1; j++) ans.Add(0);
            }
        }
        return $"{ans.Count}\n{string.Join(" ", ans)}";
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


// C# program to build the smallest number
// by removing n digits from a given number
using System;
using System.Collections.Generic;
using System.Linq;
class GFG
{
    public static void Main(String[] args)
    {
        var t = int.Parse(Console.ReadLine());
        while (t > 0)
        {
            // var input = Console.ReadLine().Split(' ');
            //var n = int.Parse(input[0]);
            // var k = long.Parse(input[1]);
            // var arr = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            // MAXXor(n, k, arr);
            var n = int.Parse(Console.ReadLine());
            Science(n);
            t--;
        }

    }

    public static void Science(int totalMass)
    {
        List<long> inc = new List<long>();

        for (int i = 1; i <= totalMass; i *= 2)
        {
            inc.Add(i);
            totalMass -= i;
        }

        if (totalMass > 0)
        {
            inc.Add(totalMass);
            inc.Sort();
        }

        Console.Write(inc.Count - 1);

        Console.WriteLine();
        for (int i = 1; i < inc.Count; i++)
        {
            Console.Write((inc[i] - inc[i - 1]) + " ");
        }
        Console.WriteLine();
    }

}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Template;
using Pi = Pair<int, int>;

class Solver
{
    public void Solve(Scanner sc)
    {
        var t = sc.Int;
        while (t-- > 0)
        {
            var N = sc.Int;
            N--;
            int l = -1, r = 1000000007;
            while (r - l > 1)
            {
                var m = (r + l) / 2;
                var now = N - m;
                if (now < 0) { r = m;continue; }
                var ct = 1;
                for (int i = 1; i <= m;){
                    var cost = m - i + 1;
                    var d = Min(ct, now / cost);
                    now -= d * cost;ct += d;
                    i = Max(i + 1, m - now + 1);
                }
                if (now > 0) l = m;
                else r = m;
            }
            Console.WriteLine(r);
            {
                var now = N - r;
                var ct = 1;
                var res = new int[r];
                for(int i = 1; i <= r;)
                {
                    var cost = r - i + 1;
                    var d = Min(ct, now / cost);
                    res[i - 1] = d;
                    now -= d * cost; ct += d;
                    i = Max(i + 1, r - now + 1);
                }
                Console.WriteLine(string.Join(" ", res));
            }

        }
    }
}

#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        new Solver().Solve(new Scanner());
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(this IList<T> A, int i, int j) { var t = A[i]; A[i] = A[j]; A[j] = t; }
    public static T[] Create<T>(int n, Func<T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(); return rt; }
    public static T[] Create<T>(int n, Func<int, T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(i); return rt; }
    public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> A) => A.OrderBy(v => Guid.NewGuid());
    public static int CompareTo<T>(this T[] A, T[] B, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; for (var i = 0; i < Min(A.Length, B.Length); i++) { int c = cmp(A[i], B[i]); if (c > 0) return 1; else if (c < 0) return -1; } if (A.Length == B.Length) return 0; if (A.Length > B.Length) return 1; else return -1; }
    public static int MaxElement<T>(this IList<T> A, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; T max = A[0]; int rt = 0; for (int i = 1; i < A.Count; i++) if (cmp(max, A[i]) < 0) { max = A[i]; rt = i; } return rt; }
    public static T PopBack<T>(this List<T> A) { var v = A[A.Count - 1]; A.RemoveAt(A.Count - 1); return v; }
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}
public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
    //public (T1, T2) Make<T1, T2>() { Make(out T1 v1, out T2 v2); return (v1, v2); }
    //public (T1, T2, T3) Make<T1, T2, T3>() { Make(out T1 v1, out T2 v2, out T3 v3); return (v1, v2, v3); }
    //public (T1, T2, T3, T4) Make<T1, T2, T3, T4>() { Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4); return (v1, v2, v3, v4); }
}
public class Pair<T1, T2> : IComparable<Pair<T1, T2>>
{
    public T1 v1;
    public T2 v2;
    public Pair() { }
    public Pair(T1 v1, T2 v2)
    { this.v1 = v1; this.v2 = v2; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }
}
#endregion


using System;
using System.Collections.Generic;
using System.Linq;

namespace csh_olymp
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = int.Parse(Console.ReadLine());
            for (int tc = 1; tc <= t; tc++)
            {
                int n = int.Parse(Console.ReadLine());
                var lst = new List<int> { 1 };
                var sum = 1;
                while (sum < n)
                {
                    if (sum + lst.Last() * 2 > n)
                    {
                        if (sum + lst.Last() <= n)
                            lst.Add(n - sum);
                        else
                            for (int i = 1; i < lst.Count; i++)
                                if (lst[i] > n - sum)
                                {
                                    lst.Insert(i, n - sum);
                                    break;
                                }
                        break;
                    }
                    else
                    {
                        sum += lst.Last() * 2;
                        lst.Add(lst.Last() * 2);
                    }
                }
                for (int i = 0; i < lst.Count - 1; i++)
                    lst[i] = lst[i + 1] - lst[i];
                lst.RemoveAt(lst.Count - 1);
                Console.WriteLine(lst.Count);
                Console.WriteLine($"{string.Join(" ", lst)}");
            }

        }
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
using System.Text;
using System.Threading;
using System.Globalization;
using System.Runtime.CompilerServices;
using Library;

namespace Program
{
    public static class CODEFORCES2
    {
        static bool SAIKI = false;
        static public int numberOfRandomCases = 0;
        static public void MakeTestCase(List<string> _input, List<string> _output, ref Func<string[], bool> _outputChecker)
        {
        }
        static public void Solve()
        {
            var t = NN;
            for (var i = 0; i < t; i++)
            {
                var n = NN;
                var sum = 1L;
                var zouka = 1L;
                var ans = new List<long>();
                while (sum < n)
                {
                    ans.Add(zouka);
                    zouka <<= 1;
                    sum += zouka;
                }
                ans.RemoveAt(ans.Count - 1);
                sum -= zouka;
                if (sum + zouka / 2 <= n)
                {
                    ans.Add(n - sum - zouka / 2);
                    Console.WriteLine(ans.Count);
                    Console.WriteLine(string.Join(" ", ans));
                }
                else
                {
                    ans.RemoveAt(ans.Count - 1);
                    zouka >>= 1;
                    sum -= zouka;
                    ans.Add(n - sum - zouka - zouka / 2);
                    ans.Add(zouka / 2 - ans.Last());
                    Console.WriteLine(ans.Count);
                    Console.WriteLine(string.Join(" ", ans));
                }
            }
        }
        class Printer : StreamWriter
        {
            public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
            public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }
            public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }
        }
        static LIB_FastIO fastio = new LIB_FastIODebug();
        static public void Main(string[] args) { if (args.Length == 0) { fastio = new LIB_FastIO(); Console.SetOut(new Printer(Console.OpenStandardOutput())); } if (SAIKI) { var t = new Thread(Solve, 134217728); t.Start(); t.Join(); } else Solve(); Console.Out.Flush(); }
        static long NN => fastio.Long();
        static double ND => fastio.Double();
        static string NS => fastio.Scan();
        static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();
        static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();
        static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();
        static long Count<T>(this IEnumerable<T> x, Func<T, bool> pred) => Enumerable.Count(x, pred);
        static IEnumerable<T> Repeat<T>(T v, long n) => Enumerable.Repeat<T>(v, (int)n);
        static IEnumerable<int> Range(long s, long c) => Enumerable.Range((int)s, (int)c);
        static IOrderedEnumerable<T> OrderByRand<T>(this IEnumerable<T> x) => Enumerable.OrderBy(x, _ => xorshift);
        static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> x) => Enumerable.OrderBy(x.OrderByRand(), e => e);
        static IOrderedEnumerable<T1> OrderBy<T1, T2>(this IEnumerable<T1> x, Func<T1, T2> selector) => Enumerable.OrderBy(x.OrderByRand(), selector);
        static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> x) => Enumerable.OrderByDescending(x.OrderByRand(), e => e);
        static IOrderedEnumerable<T1> OrderByDescending<T1, T2>(this IEnumerable<T1> x, Func<T1, T2> selector) => Enumerable.OrderByDescending(x.OrderByRand(), selector);
        static IOrderedEnumerable<string> OrderBy(this IEnumerable<string> x) => x.OrderByRand().OrderBy(e => e, StringComparer.OrdinalIgnoreCase);
        static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> x, Func<T, string> selector) => x.OrderByRand().OrderBy(selector, StringComparer.OrdinalIgnoreCase);
        static IOrderedEnumerable<string> OrderByDescending(this IEnumerable<string> x) => x.OrderByRand().OrderByDescending(e => e, StringComparer.OrdinalIgnoreCase);
        static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> x, Func<T, string> selector) => x.OrderByRand().OrderByDescending(selector, StringComparer.OrdinalIgnoreCase);
        static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }
        static IEnumerator<uint> _xsi = _xsc();
        static IEnumerator<uint> _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }
    }
}
namespace Library {
    class LIB_FastIO
    {
        public LIB_FastIO() { str = Console.OpenStandardInput(); }
        readonly Stream str;
        readonly byte[] buf = new byte[1024];
        int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        byte read()
        {
            if (isEof) throw new EndOfStreamException();
            if (ptr >= len)
            {
                ptr = 0;
                if ((len = str.Read(buf, 0, 1024)) <= 0)
                {
                    isEof = true;
                    return 0;
                }
            }
            return buf[ptr++];
        }
        char Char()
        {
            byte b = 0;
            do b = read();
            while (b < 33 || 126 < b);
            return (char)b;
        }
        virtual public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        virtual public long Long()
        {
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != '-' && (b < '0' || '9' < b));
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        virtual public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }
    }
    class LIB_FastIODebug : LIB_FastIO
    {
        Queue<string> param = new Queue<string>();
        string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }
        public LIB_FastIODebug() { }
        public override string Scan() => NextString();
        public override long Long() => long.Parse(NextString());
        public override double Double() => double.Parse(NextString());
    }
}


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using static System.Math;
using System.Text;
using System.Threading;
using System.Globalization;
using System.Runtime.CompilerServices;
using Library;

namespace Program
{
    public static class CODEFORCES2
    {
        static bool SAIKI = false;
        static public int numberOfRandomCases = 0;
        static public void MakeTestCase(List<string> _input, List<string> _output, ref Func<string[], bool> _outputChecker)
        {
        }
        static public void Solve()
        {
            var t = NN;
            for (var i = 0; i < t; i++)
            {
                var n = NN;
                var sum = 1L;
                var zouka = 1L;
                var ans = new List<long>();
                while (sum < n)
                {
                    ans.Add(zouka);
                    zouka <<= 1;
                    sum += zouka;
                }
                ans.RemoveAt(ans.Count - 1);
                sum -= zouka;
                if (sum + zouka / 2 <= n)
                {
                    ans.Add(n - sum - zouka / 2);
                    Console.WriteLine(ans.Count);
                    Console.WriteLine(string.Join(" ", ans));
                }
                else
                {
                    ans.RemoveAt(ans.Count - 1);
                    zouka >>= 1;
                    sum -= zouka;
                    zouka >>= 1;
                    {
                        var left = 0L;
                        var right = zouka;
                        while (right - left > 1)
                        {
                            var mid = (right + left) / 2;
                            var tot = sum + zouka + mid;
                            tot += zouka + mid;
                            if (tot > n) right = mid;
                            else left = mid;
                        }
                        ans.Add(left);
                        zouka += left;
                        sum += zouka;
                        ans.Add(n - sum - zouka);
                    }
                    Console.WriteLine(ans.Count);
                    Console.WriteLine(string.Join(" ", ans));
                }
            }
        }
        class Printer : StreamWriter
        {
            public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
            public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { base.AutoFlush = false; }
            public Printer(Stream stream, Encoding encoding) : base(stream, encoding) { base.AutoFlush = false; }
        }
        static LIB_FastIO fastio = new LIB_FastIODebug();
        static public void Main(string[] args) { if (args.Length == 0) { fastio = new LIB_FastIO(); Console.SetOut(new Printer(Console.OpenStandardOutput())); } if (SAIKI) { var t = new Thread(Solve, 134217728); t.Start(); t.Join(); } else Solve(); Console.Out.Flush(); }
        static long NN => fastio.Long();
        static double ND => fastio.Double();
        static string NS => fastio.Scan();
        static long[] NNList(long N) => Repeat(0, N).Select(_ => NN).ToArray();
        static double[] NDList(long N) => Repeat(0, N).Select(_ => ND).ToArray();
        static string[] NSList(long N) => Repeat(0, N).Select(_ => NS).ToArray();
        static long Count<T>(this IEnumerable<T> x, Func<T, bool> pred) => Enumerable.Count(x, pred);
        static IEnumerable<T> Repeat<T>(T v, long n) => Enumerable.Repeat<T>(v, (int)n);
        static IEnumerable<int> Range(long s, long c) => Enumerable.Range((int)s, (int)c);
        static IOrderedEnumerable<T> OrderByRand<T>(this IEnumerable<T> x) => Enumerable.OrderBy(x, _ => xorshift);
        static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> x) => Enumerable.OrderBy(x.OrderByRand(), e => e);
        static IOrderedEnumerable<T1> OrderBy<T1, T2>(this IEnumerable<T1> x, Func<T1, T2> selector) => Enumerable.OrderBy(x.OrderByRand(), selector);
        static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> x) => Enumerable.OrderByDescending(x.OrderByRand(), e => e);
        static IOrderedEnumerable<T1> OrderByDescending<T1, T2>(this IEnumerable<T1> x, Func<T1, T2> selector) => Enumerable.OrderByDescending(x.OrderByRand(), selector);
        static IOrderedEnumerable<string> OrderBy(this IEnumerable<string> x) => x.OrderByRand().OrderBy(e => e, StringComparer.OrdinalIgnoreCase);
        static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> x, Func<T, string> selector) => x.OrderByRand().OrderBy(selector, StringComparer.OrdinalIgnoreCase);
        static IOrderedEnumerable<string> OrderByDescending(this IEnumerable<string> x) => x.OrderByRand().OrderByDescending(e => e, StringComparer.OrdinalIgnoreCase);
        static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> x, Func<T, string> selector) => x.OrderByRand().OrderByDescending(selector, StringComparer.OrdinalIgnoreCase);
        static uint xorshift { get { _xsi.MoveNext(); return _xsi.Current; } }
        static IEnumerator<uint> _xsi = _xsc();
        static IEnumerator<uint> _xsc() { uint x = 123456789, y = 362436069, z = 521288629, w = (uint)(DateTime.Now.Ticks & 0xffffffff); while (true) { var t = x ^ (x << 11); x = y; y = z; z = w; w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); yield return w; } }
    }
}
namespace Library {
    class LIB_FastIO
    {
        public LIB_FastIO() { str = Console.OpenStandardInput(); }
        readonly Stream str;
        readonly byte[] buf = new byte[1024];
        int len, ptr;
        public bool isEof = false;
        public bool IsEndOfStream { get { return isEof; } }
        byte read()
        {
            if (isEof) throw new EndOfStreamException();
            if (ptr >= len)
            {
                ptr = 0;
                if ((len = str.Read(buf, 0, 1024)) <= 0)
                {
                    isEof = true;
                    return 0;
                }
            }
            return buf[ptr++];
        }
        char Char()
        {
            byte b = 0;
            do b = read();
            while (b < 33 || 126 < b);
            return (char)b;
        }
        virtual public string Scan()
        {
            var sb = new StringBuilder();
            for (var b = Char(); b >= 33 && b <= 126; b = (char)read())
                sb.Append(b);
            return sb.ToString();
        }
        virtual public long Long()
        {
            long ret = 0; byte b = 0; var ng = false;
            do b = read();
            while (b != '-' && (b < '0' || '9' < b));
            if (b == '-') { ng = true; b = read(); }
            for (; true; b = read())
            {
                if (b < '0' || '9' < b)
                    return ng ? -ret : ret;
                else ret = ret * 10 + b - '0';
            }
        }
        virtual public double Double() { return double.Parse(Scan(), CultureInfo.InvariantCulture); }
    }
    class LIB_FastIODebug : LIB_FastIO
    {
        Queue<string> param = new Queue<string>();
        string NextString() { if (param.Count == 0) foreach (var item in Console.ReadLine().Split(' ')) param.Enqueue(item); return param.Dequeue(); }
        public LIB_FastIODebug() { }
        public override string Scan() => NextString();
        public override long Long() => long.Parse(NextString());
        public override double Double() => double.Parse(NextString());
    }
}