#include <bits/stdc++.h>
using namespace std;
bool _isPrime(int n) {
  if (n == 2) return true;
  if (n < 2 || n % 2 == 0) return false;
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return false;
  return true;
}
int row, col;
int fx[] = {1, -1, 0, 0};
int fy[] = {0, 0, 1, -1};
struct Point {
  int x;
  int y;
};
bool _Asc_compare(Point lhs, Point rhs) { return lhs.x < rhs.x; }
bool _Desc_compare(Point lhs, Point rhs) { return lhs.x > rhs.x; }
int _unique(int x, int y) { return (x + (y * 100000)); }
string s, t;
char ch, dh;
char crr[101][101];
int a, b, c, d, e, n, x, y, z;
vector<string> A(55);
vector<int> V[100010];
int clr[100][100], par[100010], ans = 0, cat = 0;
void fun(int n) {
  cout << n << " ";
  for (int i = n - 1; i > 0; i--) {
    if (n % i == 0) {
      fun(i);
      return;
    }
  }
}
int main() {
  cin >> n;
  fun(n);
}
