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