# -*- coding: utf8 -*-
import sys
for s in sys.stdin: # 從標準輸入,讀入一行
s = s.strip()
a = int(s)
b = 2
c = 0
k = str(s)+"="
for i in range(100000):
if a%b==0:
while(a%b==0):
a = a/b
c = c+1
if c>1:
k = k+str(b)+"^"+str(c)
elif c<2:
k = k+str(b)
elif a%b!=0:
b=b+1
print(k)
# -*- coding: utf8 -*-
import sys
for s in sys.stdin: # 從標準輸入,讀入一行
s = s.strip()
a = int(s)
b = 2
c = 0
k = str(s)+"="
for i in range(100000):
if a%b==0:
while(a%b==0):
a = a/b
c = c+1
if c>1:
k = k+str(b)+"^"+str(c)
elif c<2:
k = k+str(b)
elif a%b!=0:
b=b+1
print(k)
這樣的迴圈不對。