n=gets.to_i # f[49]=000_000_000_0 # f[50]=000_000_000_000 if n>49 puts '000000000000' exit(0) end fact=(1..n).inject(1){|f, i| f*=i} ans=[] while ans.size<12 and fact.nonzero? ans<< fact%10 fact/=10 end puts ans.reverse.join("")