#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 10;
int main() {
  int t, n;
  for (scanf("%d", &t); t--;) {
    scanf("%d", &n);
    --n;
    vector<int> vec;
    int i = 0;
    while (n == (1 << (i + 1)) || n >= (1 << (i + 2))) {
      vec.emplace_back(1 << i);
      ++i;
      n -= 1 << i;
    }
    if (n) {
      assert(n >= (1 << i));
      if (n >= (3 << i)) {
        int m = n - (1 << (i + 1));
        vec.emplace_back(m - (1 << i));
        vec.emplace_back((1 << (i + 1)) - m);
      } else if (n >= (1 << (i + 1))) {
        vec.emplace_back(0);
        n -= 1 << i;
        vec.emplace_back(n - (1 << i));
      } else {
        vec.emplace_back(n - (1 << i));
      }
    }
    printf("%d\n", vec.size());
    for (int x : vec) printf("%d ", x);
    puts("");
  }
  return 0;
}
