#include<stdio.h>
int main()
{
    long int n;
    while(scanf("%d",&n)!=EOF)
    {
        int i;
        for(i=2;i<=sqrt(n);i++)
        {
            while(n!=i)
            {
                if (n%i==0)
                {
                    printf("%ld ",i);
                    n=n/i;
                }
                else
                    break;
            }
            
        }
    }
    printf("%ld\n",n);
    return 0;
}