#22591: Python (AC)


mcg25035@gmail.com (南瓜切)


z=[]

a=int(input())

b=2

while not a==1:

while not a%b==0:

b+=1

a=a/b

z=z+[b]

b=2

zs=set(z)

k=''

for c in zs:

m=0

for u in z:

if u == c:

m+=1

if m==1:

if k=='':

k=str(c)

else:

k=k+' * '+str(c)

else:

if k=='':

k=str(c)+'^'+str(m)

else:

k=str(c)+'^'+str(m)+' * '+k

print(k)