#include <bits/stdc++.h>
using namespace std;
long long t;
long long n;
int main() {
  cin >> t;
  for (; t >= 1; --t) {
    cin >> n;
    vector<long long> f;
    for (int i = 1; i <= trunc(sqrt(n)); ++i)
      if (n / i == i)
        f.push_back(i);
      else
        f.push_back(i), f.push_back(n / i);
    f.push_back(0);
    sort(f.begin(), f.end());
    cout << f.size() << endl;
    for (int i = 0; i < f.size(); ++i) cout << f[i] << " ";
    cout << endl;
  }
  return 0;
}
