require 'prime' L, H = gets.split.map(&:to_i) factor = 0 ans_list = [] (Math.sqrt(H).round).downto(2){|i| flag = false (H / i).downto(i){|j| if i * j < L break end tmp = Prime.prime_division(i * j)[0][0] if factor < tmp factor = tmp ans_list.clear end if factor == tmp ans_list.push(i * j) end if factor > i flag = true break end } break if flag } p ans_list.max