#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> vc;
    vc.clear();
    for (int i = 1; i <= sqrt(n); i++) {
      if (n / i != i) vc.push_back(n / i);
    }
    int rt = sqrt(n);
    cout << rt + vc.size() + 1 << endl;
    cout << 0 << ' ';
    for (int i = 1; i <= sqrt(n); i++) {
      cout << i << ' ';
    }
    for (int i = vc.size() - 1; i >= 0; i--) cout << vc[i] << ' ';
    cout << endl;
  }
}
