#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n;
  cin >> t;
  set<long long int> unicrating;
  set<long long int>::iterator uniciterator;
  for (long long int i = 0; i < t; i++) {
    cin >> n;
    long long int sqrtofn = sqrt(n);
    for (long long int j = 1; j <= sqrtofn; j++) {
      unicrating.insert(j);
      unicrating.insert(n / j);
    }
    unicrating.insert(0);
    cout << unicrating.size() << endl;
    for (uniciterator = unicrating.begin(); uniciterator != unicrating.end();
         uniciterator++) {
      cout << *uniciterator << " ";
    }
    cout << endl;
    unicrating.clear();
  }
}
