#include <bits/stdc++.h>
using namespace std;
bool b[1000050];
vector<int> v;
vector<int> v1;
int main() {
  int n;
  cin >> n;
  int u = sqrt(n);
  if (n == 1) {
    cout << 1;
    return 0;
  }
  for (int i = 2; i <= u; i++) {
    if (!b[i]) {
      for (int j = i * i; j <= n; j += i) b[j] = 1;
    }
  }
  for (int i = 2; i <= n; i++)
    if (!b[i]) {
      v.push_back(i);
    }
  v1.push_back(n);
  int j = 0;
  while (1) {
    while (n % v[j] != 0) j++;
    while (n % v[j] == 0) {
      n /= v[j];
      v1.push_back(n);
    }
    if (j == v.size() - 1 || n == 1) break;
  }
  for (int i = 0; i < v1.size(); i++) cout << v1[i] << " ";
  return 0;
}
