#include <bits/stdc++.h>
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const long long int int_max = 1e18;
const long long int int_min = -1e18;
const long double PI = acos(-1);
using namespace std;
set<long long int> s;
void printdivisors(long long int n) {
  s.insert(n);
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      s.insert(n / i);
      s.insert(i);
    }
  }
}
void solve() {
  long long int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << '\n';
    return;
  }
  printdivisors(n);
  vector<long long int> ans;
  ans.push_back(*s.rbegin());
  s.erase(*s.rbegin());
  vector<long long int> v;
  for (long long int i : s) {
    v.push_back(i);
  }
  long long int temp = ans[0];
  for (long long int i = v.size() - 1; i >= 0; i--) {
    if (temp % v[i] == 0) {
      temp = v[i];
      ans.push_back(temp);
    }
  }
  for (long long int i : ans) cout << i << ' ';
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL);
  solve();
}
