#include <bits/stdc++.h>
using namespace std;
bool prime[1000009];
long long d[1000009], n;
void sieve(int n) {
  memset(prime, 1, sizeof(prime));
  prime[1] = 0;
  for (int i = 2; i <= n; i++) {
    if (prime[i] == 0) continue;
    d[i] = i;
    for (int j = i * 2; j <= n; j += i) {
      prime[j] = 0;
      d[j] = i;
    }
  }
}
vector<long long> v;
void factorize(long long X) {
  long long res = 0;
  while (X != 1) {
    v.push_back(X);
    X /= d[X];
  }
  v.push_back(1);
}
int main() {
  cin >> n;
  sieve(n + 9);
  factorize(n);
  long long last = n;
  vector<long long> res;
  for (int i = 0; i < v.size(); i++) {
    if (last % v[i] == 0) {
      res.push_back(v[i]);
      last = v[i];
    }
  }
  for (int i = 0; i < res.size(); i++) cout << res[i] << " ";
  return 0;
}
