#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  if (n == 2) {
    cout << 1 << endl << 0 << endl;
    return;
  }
  if (n == 3) {
    cout << 1 << endl << 1 << endl;
    return;
  }
  long long curr = 1;
  int levels = 0;
  while (curr < n) {
    curr = 2 * curr + 1;
    levels++;
  }
  cout << levels << endl;
  curr = 1;
  for (int q = 1; q < levels - 1; q++) {
    cout << curr << " ";
    curr *= 2;
  }
  int w = curr * 2;
  if (n - 2 * w >= 4 * w - n) {
    cout << curr << " " << (n - 3 * w + 1) << endl;
  } else {
    int z = (3 * w - n) / 2;
    cout << (w - z - curr) << " " << ((n + 1) % 2) << endl;
  }
}
int main() {
  int t;
  cin >> t;
  for (int q = 0; q < t; q++) {
    solve();
  }
  return 0;
}
