#include<iostream>
#include<math.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    while(N != 1){
        int i = 2,flag = 0;
        while(N % i != 0){
            i++;
            if(i>sqrt(N)){//这里需要优化一下,不然有一组用例时间超时
                flag = 1;
                break;
            }
        }
        if(flag==0)
            cout << i << ' ';
        else{
            cout << N << ' ';
            return 0;
        }
        N = N/i;
    }
}