#!/usr/bin/ruby -Ku

require 'pp'

n = gets.split(nil)[0].to_i

b = [100, 0]

n.times{
  data = gets.split(nil)
  a, v = data.map{|e|e.to_i}
  if b[1] < v then
    b[0] = a
    b[1] = v
  elsif b[1] == v
    b[0] = [a, b[0]].min
  end
}

puts "#{b[0]} #{b[1]}"