#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;

int main(){
  int n;
  int num=1,max=0;
  int tmpnum,tmp;
    cin>>n;
    while(n){
        cin>>tmpnum>>tmp;
        if(max<tmp){
            num=tmpnum;
            max=tmp;
        }
        --n;
    }
    cout<<num<<" "<<max<<endl;
  return 0;
}
