def scan; gets.split.map(&:to_i); end n = scan[0] r = 1 2.upto(n){|i| r=(i*r) if r.modulo(1000000000000)==0 puts "0"*12 exit end } if r >= 1000000000000 p r.modulo(1000000000000) else puts sprintf("%012d",r.modulo(1000000000000)) end