#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    vector<ll> v;
    ll T, x;
    scanf("%lld", &T);
    while (T--)
    {
        v.clear();
        scanf("%lld", &x);
        ll part1 = 0, part2 = 0;
        for (int i = 62; i > 0; i -= 2)
            if (x >> i & 1)
                part1 |= 1ll << i;
        for (int i = 61; i > 0; i -= 2)
            if (x >> i & 1)
                part2 |= 1ll << i;
        ll base = 1;
        while ((x & 1) == 0) x >>= 1, base <<= 1;
        for (int i = 62; i > 0; i -= 2)
            if (x >> i & 1)
            {
                ll n = 1ll << (i - 1) | 1;
                v.push_back(n * base * 2);
            }
        for (int i = 61; i > 0; i -= 2)
            if (x >> i & 1)
            {
                ll n = 1ll << i | 1;
                v.push_back(n * base);
            }
        cout << v.size();
        for (auto x : v) cout << " " << x;
        cout << endl;
    }
    return 0;
}