#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x1 = 0, x2 = 0, s = 0, vs1 = 0, vs2 = 0;
  cin >> n;
  vector<int> v1, v2, v3;
  x1 = x2 = n;
  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;
  }
  v1.push_back(v3[v3.size() - 1]);
  vs1 = v3[v3.size() - 1];
  s = 0;
  for (int i = v3.size() - 2; i >= 0; --i) {
    if (vs1 % v3[i] == 0) {
      v1.push_back(v3[i]);
      x1 += v3[i];
      vs1 = v3[i];
    }
  }
  for (int i = 0; i < v1.size(); ++i) {
    cout << v1[i] << " ";
  }
  cout << "1" << endl;
  return 0;
}
