x = int(input())
if x == 1:
print("1")
else:
num = 2
count = 0
while True:
if x % num == 0:
while True:
count += 1
x //= num
#print('x = %d num = %d count = %d'%(x,num,count))
if x % num != 0:
if count > 1:
if x == 1:
print("%d^%d " %(num, count),end = '')
else:
print("%d^%d * " %(num, count),end = '')
else:
if x == 1:
print("%d" %(num),end = '')
else:
print("%d * " %(num),end = '')
count = 0
num += 1
break
else:
num += 1
if x == 1:
break