import sys
sys.setrecursionlimit(100000)
def yeah(m = {}, num = 0, i = 2):
if i > num:
return m
if num % i != 0:
return yeah(m = m, num = num, i = i+1)
mi = False
try:
if m[i]:
mi = True
except:
pass
if mi:
m[i] += 1
else:
m[i] = 1
return yeah(m = m, num = num//i, i = i)
DICT = yeah(num = int(input()))
key_array = list(DICT.keys())
for key in key_array:
if DICT[key] == 1:
print(key, end = '')
else:
print(f'{key}^{DICT[key]}', end = '')
if key_array.index(key) != len(key_array) - 1:
print(' * ', end = '')