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