hs2={} i=1 j=1 60.times{ hs2[j]=i j+=1 i=(i*j)%(10**12) } n=gets.to_i if n<=15 puts hs2[n] elsif n<59 printf("%012d\n",hs2[n]) else puts "0"*12 end