#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, vs1 = 0;
  cin >> n;
  vector<int> v3;
  for (int i = 2; i <= sqrt(n); ++i) {
    if (n % i == 0) {
      v3.push_back(i);
      if ((n / i) != i) v3.push_back(n / i);
    }
  }
  sort(v3.begin(), v3.end());
  cout << n << " ";
  if (n == 1) {
    return 0;
  }
  if (v3.size() == 0) {
    cout << "1" << endl;
    return 0;
  }
  for (int i = v3.size() - 1; i >= 0; --i) {
    if (vs1 % v3[i] == 0) {
      cout << v3[i] << " ";
      vs1 = v3[i];
    }
  }
  cout << "1" << endl;
  return 0;
}
