#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[100005];
    int k = 0;
    for (long long i = 1; i * i <= n; i++) {
      if (i != n / i) {
        a[k++] = i;
        a[k++] = n / i;
      } else {
        a[k++] = i;
      }
    }
    cout << k + 1 << endl;
    cout << "0"
         << " ";
    sort(a, a + k);
    for (int i = 0; i < k; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
