#48158: python 解法


olivia080326@gmail.com (嘻嘻)


import sys
def f(x):
    
    if x==0 or x==1:
        print("1", end="")
        return 1
    else:
        print(f"{x} * ", end="")
        return f(x-1)*x
    

for s in sys.stdin:
    x=int(s)
    print(f"{x}! = ", end="")
    ans=f(x)
    print(f" = {ans} ")