#include <iostream>
using namespace std;
unsigned int factori[10000][2];
int main(){
int n, d=2, i, k=0;
cin>>n;
while(n > 1){
if(n%d == 0){
while(n%d == 0){
factori[k][0] = d;
factori[k][1]++;
n = n/d;
}
k++;
}
d++;
}
//rezultatele stocate in
//factori[i] - factori[i][0] e baza, iar factori[i][1] exponentul
cout<<"descompunere:"<<endl;
for(i=0;i<k;i++){
cout<<factori[i][0]<<"^"<<factori[i][1]<<", ";
}
cout<<endl;
if(k<=1){
cout<<"Este numar prim";
}else{
cout<<"Nu este numar prim";
}
}