require'prime' l,h=gets.split.map &:to_i a=[*Prime.each(h**0.5)].reverse a.map{|x|(h/x*x).step(l,-x){|t|(p t;exit)if !a.any?{|q|q