#include<bits/stdc++.h>
#define CT cout << "\n-----------------------\n";
using namespace std;
typedef long long ll;
const int inf=1<<30;
const ll Inf=1ll<<60;
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	int m=n;
	for(int i=2;i*i<=m;++i){
		if(n%i) continue;
		while(n%i==0){
			cout << i << ' ';
			n/=i;
		}
	}
	if(n!=1) cout << n << '\n';
	else cout << '\n';
	return 0;
}

