#include <iostream>
using namespace std;
int main(){
  int n,a,b,max = 0,ans;
  cin >> n;
  while(n--){
    cin >> a >> b;
    if(max < b ){
      max = b;
      ans = a;
    }
  }
  cout << ans << " " << max << endl; 
}