#include <iostream>
#include <math.h>
using namespace std;
bool is_prime(unsigned long long n) { //quick
unsigned long long stop = n / 6 + 1, Tstop = sqrt(n) + 5;
if (n == 2 || n == 3 || n == 5 || n == 7 || n == 11) {
return 1;
}
if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0 || n == 1) {
return 0;
}
for (unsigned long long i = 1; i <= stop; i++) {
if (i * 6 >= Tstop) { break; }
if ((n % (i * 6 + 1) == 0) || (n % (i * 6 + 5) == 0)) {
return 0;
}
}
return 1;
}
void printZhi(int n) {
if (is_prime(n)) {
cout << n << " ";
return;
}
int i = 2;
for (;i <= sqrt(n);++i) {
if (n % i == 0) {
printZhi(i);
printZhi(n / i);
break;
}
}
}
int main()
{
int a;
while (cin >> a) {
printZhi(a);
cout << endl;
}
return 0;
}