#include <bits/stdc++.h>
using namespace std;
vector<int> divs[1000007], v;
int dp1[1000007], dp2[1000007];
int main() {
  int iter = 0;
  int m;
  scanf("%d", &m);
  int i, j;
  dp1[1] = 1;
  dp2[1] = 1;
  for (int i = 1; i <= m; i++) dp1[i] = 1, dp2[i] = 1;
  for (int i = 2; i <= m; i++) {
    dp2[i] = dp2[dp1[i]] + 1;
    for (int j = 2 * i; j <= m; j += i)
      if (dp2[i] > dp2[dp1[j]]) dp1[j] = i;
  }
  int cur = m;
  while (cur != 1) {
    v.push_back(cur);
    cur = dp1[cur];
  }
  v.push_back(1);
  for (auto x : v) printf("%d ", x);
  return 0;
}
