#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int N = 2e2 + 7;
const int M = 1e9 + 7;
const long long MAXN = 1e18 + 7;
const long long Mod = 998244353;
int _, i, j, k, n, m, t, T, p, s, x, y, z, l, r, h, len, o, u, v, w, st, en, sx,
    sy, ma, mi, th, num, flag, ans, mid, cnt, now, tmp;
int a[N], c[N];
vector<int> g;
char ch;
string s1, s2, s3;
signed main() {
  ios::sync_with_stdio(false);
  int t = 1;
  cin >> t;
  while (t--) {
    cin >> n;
    n--;
    k = 1;
    g.clear();
    while (n >= 3 * (1 << k)) {
      g.push_back(1 << (k - 1));
      n -= (1 << k);
      k++;
    }
    if (k == 1) {
      if (n == 1)
        cout << 1 << endl << 0 << endl;
      else if (n == 2)
        cout << 1 << endl << 1 << endl;
      else if (n == 3)
        cout << 2 << endl << 0 << " " << 1 << endl;
      else if (n == 4)
        cout << 2 << endl << 1 << " " << 0 << endl;
      else
        cout << 2 << endl << 1 << " " << 1 << endl;
      continue;
    }
    if (n == (1 << k))
      g.push_back(1 << (k - 1));
    else {
      k--;
      m = max(1 << k, int(ceil(1.0 * n / 3))) - (1 << k);
      g.push_back(m), g.push_back(n - 2 * (m + (1 << k)));
    }
    cout << g.size() << endl;
    for (i = 0; i < g.size(); i++) cout << g[i] << " ";
    cout << endl;
  }
  return 0;
}
