#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tc = 1;
  cin >> tc;
  long long n, root, ans, i;
  while (tc--) {
    cin >> n;
    ans = 1;
    root = sqrt(n);
    if (n / root == root) ans--;
    ans += (root * 2);
    cout << ans << '\n' << "0 ";
    for (i = 1; i <= root; i++) cout << i << " ";
    for (i = root; i > 0; i--) {
      if (n / i == root) continue;
      cout << n / i << " ";
    }
    cout << '\n';
  }
  return 0;
}
