#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long x = 1;
    queue<long long> a;
    a.push(0);
    a.push(1);
    while (x < n) {
      long long l = 0;
      long long r = n;
      while (r - l > 1) {
        long long mid = (l + r) / 2;
        long long p = n / mid;
        if (p > x) {
          l = mid;
        } else if (p <= x) {
          r = mid;
        }
      }
      a.push(n / l);
      x = n / l;
    }
    cout << a.size() << endl;
    while (!a.empty()) {
      cout << a.front() << " ";
      a.pop();
    }
    cout << endl;
  }
  return 0;
}
