f = 1 for i in xrange(1, min(input()+1, 100)): f = f * i print "%012d" % (f % (10**12))