require'prime' l,h=gets.split.map &:to_i a=*Prime.each(h**0.5) (x=a.pop;(h/x*x).step(l,-x){|t|a.any?{|q|t%q<1}||(p t;exit)})while a[0]