#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<int> s;
    s.insert(0);
    int i = 1, j = n;
    while (i <= n / i) {
      j = n / i;
      if (n / j == i) {
        s.insert(i);
        s.insert(j);
      }
      i++;
    }
    cout << s.size() << endl;
    auto it = s.begin();
    while (it != s.end()) {
      cout << (*it) << " ";
      it++;
    }
    cout << endl;
  }
}
