#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int num;
    while(cin>>num)
    {
        int val=num;
        for(int i=2;i<=sqrt(num);i++)
        {
            while(val%i==0)
            {
                cout<<i<<" ";
                val=val/i;
            }
        }
        if(val>1){
            cout<<val<<" ";
        }
    }
    return 0;
}