require 'prime' l,h=gets.split.map(&:to_i) r=0;v=nil j=Math.sqrt(h).to_i+1 while !v||j>=v j-=1 next if h/j*j