require 'prime' l,h=gets.split(" ").map(&:to_i) ansval=nil #暫定の最小の素因数 answer=0 #暫定の解 Math::sqrt(h).to_i.downto(2){|j| next if h/j*j