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