#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<algorithm>
using namespace std;
#define ma 65540
int m[ma];
int prim( )
{
memset( m, 0, sizeof( m ));
int i, j, cnt = 0;
for( i =2; i<=ma; i++)
{
if( m[i] == 0)
{
cnt++;
for( j =1; i*j<=ma; j++)
{
m[j*i] = i;
}
//a[i] = cnt;
}
}
}
int main()
{
int n;
while( scanf("%d", &n) != EOF )
{
int i ,j;
for( i = 2; i<=n; i++ )
{
if( m[i] == 0)//ËØÊý
{
while( i!=n )
{
if( n%i == 0)
{
printf("%d ", i);
//printf("3\n");
n = n/i;
}
else
break;
}
if( n == i )
{
break;
}
}
}
printf("%d\n", i);
}
}