#include<stdio.h>
#include<iostream>
#include<queue>
#include<memory.h>
#include <math.h>
#include<time.h>
#include <stdlib.h>
using namespace std; const int MAX = * ;
const int MAXL = * ;
/**
* 欧拉素数筛选法
*/
int prime[MAX];
int np = ;
void primes()
{
memset(prime, -, sizeof(prime));
for(int i = ; i <= MAXL; i++)
{
if(prime[i] == -)
prime[np++] = i;
for(int j = ; j < np && prime[j] * i <= MAXL; j++)
{
if(prime[j] * i >= MAXL)
{
break;
}
prime[prime[j] * i] = ;
if(i % prime[j] == )
break;
}
}
}
int main()
{
freopen("d:\\1.txt", "r", stdin);
primes();
long long l;
bool first = true;
while (cin >> l)
{
if(l == -)
return ;
for(int i = ; i < np && prime[i] <= l; i++)
{
while (l % prime[i] == )
{
l = l / prime[i];
printf(" %d\n", prime[i]);
}
}
if(l != )
{
printf(" %lld\n", l);
}
cout << endl;
}
return ;
}