#include <bits/stdc++.h>
using namespace std;
long long sta(long long num, long long n, long long t, long long r,
              long long x) {
  t += (x - num + (num * 2)) * r;
  if (t > n) return 0;
  return 1;
}
long long bs(long long second, long long e, long long n, long long t,
             long long r) {
  long long in, mid, x = e;
  while (second <= e) {
    mid = (second + e) / 2;
    if (sta(mid, n, t, r, x)) {
      in = mid;
      second = mid + 1;
    } else
      e = mid - 1;
  }
  return in;
}
int main() {
  long long t, n;
  scanf("%lld", &t);
  while (t--) {
    scanf("%lld", &n);
    long long sum = 1, ans, total, x, r;
    for (long long i = 1;; i++) {
      sum *= 2;
      if (sum == n) {
        ans = i;
        break;
      }
      if (sum > n) {
        ans = i - 1;
        break;
      }
    }
    printf("%lld", ans), printf("\n");
    total = 1, x = 1;
    for (long long i = 1; i <= ans; i++) {
      r = ans - i + 1;
      long long val = bs(0, x, n, total, r);
      x = x - val + (val * 2);
      total += (x);
      printf("%lld", val), printf(" ");
    }
    printf("\n");
  }
}
