include Math require'prime' n,m=gets.split.map &:to_i z=lgamma(n+1)[0]/log(10)-m.prime_division.map{|p,e|t=n;(1..40).map{t/=p}.sum/e}.min*log10(m) f=z.to_i print 10**(z-f),'e',f