#include<iostream>
#include<algorithm>
#include<utility>
using namespace std;

int main(){
  int n;
  int i,num,w;
  pair<int,int> fish[100] ;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> num >> w;
    fish[i] = make_pair(-w,num);
  }
  sort(fish,fish+n);
  cout << fish[0].second << " " << (-1)*fish[0].first << endl;
}