#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
int n, t;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> vec;
    for (int l = 1, r; l <= n; l = r + 1) {
      r = n / (n / l);
      vec.push_back(n / l);
    }
    cout << vec.size() + 1 << "\n";
    cout << "0 ";
    for (int i = (int)vec.size() - 1; i >= 0; i--) printf("%d ", vec[i]);
    printf("\n");
  }
}
