#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int x = sqrt(n);
    vector<long long int> v;
    for (long long int i = 0; i <= x; i++) v.push_back(i);
    for (long long int i = 1; i <= x; i++) v.push_back(n / i);
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
    cout << v.size() << "\n";
    for (long long int i = 0; i < v.size(); i++) cout << v[i] << " ";
    cout << "\n";
  }
}
