#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const long long MOD = 1e9 + 7;
int N, M, K, Q;
void solve(int testNum) {
  int i, j;
  long long num;
  vector<int> vec;
  scanf("%lld", &num);
  for (long long d = 1l; d * d <= num; ++d) {
    if (d == num / d) {
      vec.push_back(d);
    } else {
      vec.push_back(d);
      vec.push_back(num / d);
    }
  }
  vec.push_back(0);
  sort(vec.begin(), vec.end());
  printf("%d\n", vec.size());
  for (i = 0; i < vec.size(); ++i) {
    printf("%d ", vec[i]);
  }
  printf("\n");
}
int main() {
  int T;
  scanf("%d", &T);
  for (int t = 1; t <= T; ++t) {
    solve(t);
  }
  return 0;
}
