a=int(input())
ans={}
while 1:
for i in range(2,a+1):
if a%i==0:
if i in ans:
ans[i]+=1
else:
ans[i]=1
a=a//i
break
if a==1:
b=''
for i in ans:
if ans[i] !=1:
b=f"{b}{i}^{ans[i]} * "
b=f"{b}{i} * "
b=b[:-2]
print(b)