N = int(input()) if N >= 50: print("000000000000") else: s = 1 for i in range(1, N + 1): s = s * i % 1000000000000 print(f"{s:012}" if N > 14 else s)