#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
i64 CountSteps(i64 current_count, i64 mass_required) {
  i64 result = 0;
  while (mass_required > 0) {
    current_count *= 2;
    mass_required -= current_count;
    result += 1;
  }
  return result;
}
void Partitions(i64 current_count, i64 mass_required, vector<i64>* splits) {
  while (mass_required != 0) {
    i64 steps = CountSteps(current_count, mass_required);
    i64 l = -1;
    i64 r = min(current_count, mass_required - current_count);
    while (r - l > 1) {
      i64 m = l + (r - l) / 2;
      if (CountSteps(current_count + m, mass_required - (current_count + m)) +
              1 ==
          steps) {
        r = m;
      } else {
        l = m;
      }
    }
    current_count += r;
    mass_required -= current_count;
    splits->push_back(r);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<i64> ans;
    Partitions(1, n - 1, &ans);
    cout << ans.size() << '\n';
    for (i64 x : ans) cout << x << ' ';
    cout << '\n';
  }
  return 0;
}
