#include <iostream>

using namespace std;

main(){
  int n, a, b, m = 0, d;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a >> b;
    if(m < b){
      m = b;
      d = a;
    }
  }
  cout << d << ' ' << m << endl;
}