#include <bits/stdc++.h>
using namespace std;
map<int, int> R;
int d[1010][1010], t[1010], c[1010];
void ins(int n, int f) {
  int i, l, p;
  l = sqrt(n);
  for (i = 1, p = 0; i <= l; i++)
    if (n % i == 0) {
      d[f][p++] = i;
      if (n / i != i) {
        d[f][p++] = n / i;
      }
    }
  c[f] = p;
  sort(d[f], d[f] + p);
  return;
}
int next(int f) {
  int i, r, a, b;
  for (i = 0, a = 0; i < c[f] - 1; i++) {
    b = R.find(d[f][i])->second;
    if (c[b] > a) {
      a = c[b];
      r = b;
    }
  }
  return r;
}
void impri(int f) {
  int i, r;
  printf("%d ", t[f]);
  if (t[f] != 1) {
    r = next(f);
    impri(r);
  }
  return;
}
int main() {
  int i, j, n, l, p;
  scanf("%d", &n);
  l = sqrt(n);
  for (i = 1, p = 0; i <= l; i++)
    if (n % i == 0) {
      t[p++] = i;
      if (n / i != i) t[p++] = n / i;
    }
  sort(t, t + p);
  for (i = 0; i < p; i++) {
    R[t[i]] = i;
    ins(t[i], i);
  }
  impri(p - 1);
  return 0;
}
