#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (int ti = 0; ti < t; ti++) {
    priority_queue<long long, vector<long long>, greater<long long> > pq;
    long long x;
    cin >> x;
    pq.push(0);
    for (int i = 1; i * i <= x; i++) {
      pq.push(i), pq.push(x / i);
    }
    long long la = 0;
    pq.pop();
    vector<long long> v;
    v.push_back(0);
    while (!pq.empty()) {
      if (pq.top() != la) la = pq.top(), v.push_back(la);
      pq.pop();
    }
    int ma = v.size();
    cout << ma << endl;
    for (int i = 0; i < ma; i++) cout << v[i] << " ";
    cout << endl;
  }
  return 0;
}
