#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v = {0};
    for (long long i = 1; i <= sqrt(n); i++) {
      v.push_back(i);
      if (n / i != i) v.push_back(n / i);
    }
    sort(v.begin(), v.end());
    cout << v.size() << "\n";
    for (auto i : v) cout << i << " ";
    cout << "\n";
  }
  return 0;
}
