1 2 3 4 5 6 7
n,x=input(),1 s='%d: '%n while x<n: x+=1;c=0 while not n%x:n/=x;c+=1 s+=c>1 and'%d^%d '%(x,c)or c and'%d '%x or'' print s