require "prime"
while gets
    n = $_.to_i
    smaller = 0
    Prime.each(2*n){|q|
        next if q == n
        if q > n
            puts "#{smaller} #{q}"
            break
        end
        smaller = q
    }
end