#include <bits/stdc++.h>
using namespace std;
long long int M = 1e6 + 10;
int main() {
  vector<long long int> prime(M + 5, 0);
  prime[0] = 1;
  prime[1] = 1;
  long long int v = sqrt(M);
  for (long long int i = 2; i <= v; i++) {
    if (prime[i] == 0) {
      for (long long int j = 2; j * i <= M; j++) {
        prime[j * i] = 1;
      }
    }
  }
  vector<long long int> vec;
  for (long long int i = 1; i <= M; i++) {
    if (prime[i] == 0) {
      vec.push_back(i);
    }
  }
  long long int n;
  cin >> n;
  long long int u = 0, value = n;
  cout << n << " ";
  while (n > 1) {
    while (n % vec[u] == 0) {
      n /= vec[u];
      cout << n << " ";
      value = n;
    }
    u++;
  }
  if (value != 1) cout << 1 << endl;
}
