#include <bits/stdc++.h>
int ans[1000006];
int dij[1000006];
int mmax;
void dfs(int now, int num) {
  dij[num] = now;
  for (int i = 2; i < now; i++) {
    if (now % i == 0) {
      dfs(now / i, num + 1);
    }
  }
  dij[++num] = 1;
  if (num > mmax) {
    mmax = num;
    for (int i = 0; i <= num; i++) ans[i] = dij[i];
  }
  return;
}
int main() {
  int n;
  scanf("%d", &n);
  mmax = 0;
  if (n == 1)
    printf("1\n");
  else {
    dfs(n, 0);
    for (int i = 0; i <= mmax; i++) printf("%d ", ans[i]);
    printf("\n");
  }
}
