#include <bits/stdc++.h>
using namespace std;
vector<vector<long>> v;
vector<long> vis, dp;
long ans = 0;
long dfs(long node) {
  long x;
  vis[node] = 1;
  long mx = 0;
  for (auto i : v[node]) {
    if (!vis[i]) x = dfs(i);
    mx = max(mx, dp[i] + 1);
  }
  ans = max(ans, mx);
  dp[node] = mx;
  return mx;
}
vector<long> path;
void dfs(long node, long d) {
  path.push_back(node);
  for (auto i : v[node]) {
    if (dp[i] == d - 1) {
      dfs(i, d - 1);
      break;
    }
  }
}
void addEdge(long num) {
  if (vis[num]) return;
  vis[num] = 1;
  for (long i = 1; i * i <= num; i++) {
    if (num % i == 0) {
      v[num].push_back(i);
      addEdge(i);
      if (i == 1) continue;
      if (i != num / i) {
        v[num].push_back(num / i);
        addEdge(num / i);
      }
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long x, y, n;
  cin >> n;
  dp = vector<long>(n + 1);
  v = vector<vector<long>>(n + 1);
  vis = vector<long>(n + 1);
  addEdge(n);
  vis = vector<long>(n + 1);
  for (long i = 1; i <= n; i++) {
    if (!vis[i]) dfs(i);
  }
  for (long i = 1; i <= n; i++) {
    if (dp[i] == ans) {
      dfs(i, dp[i]);
      break;
    }
  }
  sort(path.rbegin(), path.rend());
  for (auto i : path) cout << i << " ";
}
