#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long int n;
    cin >> n;
    vector<int> v;
    int ans = 1;
    for (int i = 1; i <= n; i = n / (n / i) + 1) {
      ans++;
      v.push_back(n / i);
    }
    v.push_back(0);
    std::reverse(v.begin(), v.end());
    long long int l = v.size();
    cout << ans << endl;
    for (int i = 0; i < l; i++) cout << v[i] << " ";
    cout << endl;
  }
  return 0;
}
