#include int main () { int a; int i; int n=2; scanf("%d",&a); int b=a; int v[500000]={0}; while (1) { if (a%n==0) { v[n]++; a=a/n;} else n++; if(a==1) {break;} } int m=0; for (i=2;i<=b;i++) { if (v[i] ==1&&m>0) { printf("* %d ",i);m++;} if (v[i] !=1&&v[i]!=0&&m>0) { printf("* %d^%d ",i,v[i]);m++; } if (v[i] !=1&&v[i]!=0&&m==0) { printf("%d^%d ",i,v[i]);m++; } if (v[i] ==1&&m==0) { printf("%d ",i); m++; } } return 0; }