#include <bits/stdc++.h>
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    std::vector<int> res;
    scanf("%d", &n);
    int sqn = sqrt(n);
    for (int i = 0; i <= sqn; i++) res.push_back(i);
    for (int i = sqn; i >= 1; i--) {
      if (res[res.size() - 1] != n / i) res.push_back(n / i);
    }
    printf("%d\n", res.size());
    for (int i = 0; i < res.size(); i++) printf("%d ", res[i]);
    printf("\n");
  }
  return 0;
}
