#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  void solve(int num, std::istream& in, std::ostream& out) {
    int n;
    in >> n;
    vector<int> arr;
    arr.emplace_back(n);
    int last = 1;
    while (arr.back()) {
      int bk = arr.back();
      int left = last;
      int right = n + 1;
      while (left + 1 < right) {
        int mid = (left + right) / 2;
        int d = n / mid;
        if (d == bk)
          left = mid;
        else
          right = mid;
      }
      last = right;
      arr.emplace_back(n / last);
    }
    out << arr.size() << endl;
    for (int i = 0; i < arr.size(); i++) {
      out << arr[arr.size() - 1 - i] << " ";
    }
    out << endl;
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  int T;
  in >> T;
  for (int i = 0; i < T; i++) solution.solve(i + 1, in, out);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
