def fta( n ):
i = 2
while not (n == 1):
fm = 0
while n % i == 0:
fm += 1
n //= i
if fm:
print(f"{i} ^ {fm}")
i += 1
def main():
print("Fundamental Theorem of Arithmentic")
n = int(input("N = "))
fta( n )
main()
ZGVmIGZ0YSggbiApOgogICAgaSA9IDIKICAgIHdoaWxlIG5vdCAobiA9PSAxKToKICAgICAgICBmbSA9IDAKICAgICAgICB3aGlsZSBuICUgaSA9PSAwOgogICAgICAgICAgICBmbSArPSAxCiAgICAgICAgICAgIG4gLy89IGkKICAgICAgICBpZiBmbToKICAgICAgICAgICAgcHJpbnQoZiJ7aX0gXiB7Zm19IikKICAgICAgICBpICs9IDEKICAgICAgICAKZGVmIG1haW4oKToKICAgIHByaW50KCJGdW5kYW1lbnRhbCBUaGVvcmVtIG9mIEFyaXRobWVudGljIikKICAgIG4gPSBpbnQoaW5wdXQoIk4gPSAiKSkKICAgIGZ0YSggbiApCm1haW4oKQ==