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