#include<iostream> using namespace std; int main(void) { int num; while(cin>>num) { int sum = 0; for(int n = num,a=2;a<num;a++) if(n%a==0) { cout<<a<<','; sum+=a; } if(num!=1&&++sum==num) cout<<'1'<<'\n'<<num<<endl; } return 0; }