n = gets.to_i
member = Hash.new
max = 0
n.times do
 x = gets
 y = x.split(" ")
 a = y[0].to_i
 b = y[1].to_i
 
 member[a] = b
 if max < b
  max = b
 end
end

winner = member.select{|k,v| v == max}
winner2 = Hash[winner.sort]
winner2.each do |k,v|
 puts "#{k} #{v}"
 break
end

