#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<iostream>
#define ll long long
using namespace std;
int main(){
int n;
scanf("%d",&n);
for(int i=2;i<=n;i++){
while(n%i==0){
printf("%d ",i);
n/=i;
}
}
return 0;
}
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<iostream>
#define ll long long
using namespace std;
int main(){
int n;
scanf("%d",&n);
for(int i=2;i<=n;i++){
while(n%i==0){
printf("%d ",i);
n/=i;
}
}
return 0;
}