def factor(n):
global factors
for i in range(2, n+1):
if n%i == 0:
factors.append(i)
factor(int(n/i))
break
factors = []
factor(int(input()))
o = []
while factors != []:
if factors.count(factors[0]) != 1: o.append(f'{factors[0]}^{factors.count(factors[0])}')
else: o.append(str(factors[0]))
factors = [x for x in factors if x != factors[0]]
print(' * '.join(o))