#include "stdafx.h"
#include "iostream"
#include "math.h"
using namespace std;
void get_devices(int);
int main(){
while(1){
int n; cin>>n;
if(n==0)
break;
get_devices(n);}
return 0;
}
void get_devices(int n){
for(int i=2;i<=sqrt((double)n);i++)
if(n%i==0){
cout<<i<<" ";
get_devices(n/i);
return;}
cout<<n<<endl;
}
n是整数,最大表示到2^31-1,2147483647,999999999在这个范围内,9999999999不在。