puts (n=gets.to_i)<50?((r=(2..n).inject(:*))<(v=10**12)?r:"%012d"%(r%v)):"0"*12