#include<stdio.h>
#include<math.h>
int main()
{
int math(long x);
long in, i;
long out[20] = { 0 };
scanf("%d", &in);
long p = in;
int j = 0;
for (i = 2; (i <= in) && (p != 1)&&math(p)==0;)
{
if (p % i == 0 && (math(i) == 1))
{
p = p / i;
out[j] = i;
j++;
}
else
{
i++;
}
}
if(p!=1)
{
out[j]=p;
j++;
}
for (i = 0; i < j - 1; i++)
{
printf("%d ", out[i]);
}
printf("%d\n", out[j - 1]);
return 0;
}
int math(long x)
{
if (x == 2)
{
return 1;
}
else
{
long t=x;
for (long i = 2; i <=(int)sqrt(x); i++)
{
if (x % i == 0)
{
t = i;
break;
}
}
if (t < x)
{
return 0;
}
else
{
return 1;
}
}
}