def main(): N = int(input()) j = 1 for i in range(1, N+1): j = j * i print(str(j)[-12:]) main()