<reponame>TheLurkingCat/ZeroJudge<gh_stars>1-10
while True:
    try:
        a = int(input())
    except EOFError:
        break
    ans = 1
    for i in range(1, a+1):
        ans *= i
    ans = str(ans).replace('0', '')
    print('{} -> {}'.format(a, ans[-1]))

while True:
    try:
        a = int(input())
    except EOFError:
        break
    ans = 1
    for i in range(1, a+1):
        ans *= i
    ans = str(ans).replace('0', '')
    print('{} -> {}'.format(a, ans[-1]))