#include <bits/stdc++.h>
using namespace std;
int ans[50];
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    n--;
    int cur = 1, t = 0;
    while (n) {
      if (n >= cur * 2) {
        n -= cur * 2;
        ans[++t] = cur;
      } else if (n >= cur) {
        ans[++t] = n - cur;
        n = 0;
      } else {
        n += cur;
        ans[t] = n / 2 - cur / 2;
        ans[++t] = n % 2;
        n = 0;
      }
      cur *= 2;
    }
    cout << t << endl;
    for (int i = (1); i <= (t); ++i) cout << ans[i] << " \n"[i == t ? 1 : 0];
  }
  return 0;
}
