def main(input = STDIN)
  maxv = 0
  maxa = 1 / 0.0
  input.gets.to_i.times do
    a, v = input.gets.split(" ").map(&:to_i)
    maxv, maxa = v, a if maxv < v or (maxv == v and maxa > a)
  end
  puts "#{maxa} #{maxv}"
end
main