#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x3f3f3f3f;
const int N = 1e5 + 5;
const long long mod = 1e9 + 7;
long long n, t;
int main() {
  cin >> t;
  while (t--) {
    vector<long long> ans;
    cin >> n;
    ans.push_back(0);
    while (*(ans.end() - 1) != n) {
      long long l = 1, r = n, aans, tmp = *(ans.end() - 1);
      while (l <= r) {
        long long mid = (l + r) / 2;
        if (n / mid > tmp)
          aans = (n / mid), l = mid + 1;
        else
          r = mid - 1;
      }
      ans.push_back(aans);
    }
    int sz = ans.size();
    cout << sz << endl;
    for (int i = 0; i <= sz - 1; i++) cout << ans[i] << ' ';
    cout << endl;
  }
  return 0;
}
