#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, t, sum = 0, a;
  cin >> t;
  while (t--) {
    cin >> n;
    set<long long int> s;
    s.insert(0);
    for (long long int i = 1; i <= sqrt(n); i++) {
      s.insert(i);
      s.insert(n / i);
    }
    cout << s.size() << endl;
    for (auto &i : s) cout << i << " ";
    cout << endl;
  }
  return 0;
}
