#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;

int main(){
  int n;
  cin>>n;
  P a[101];
  for(int i=0;i<n;i++) cin>>a[i].second>>a[i].first,a[i].second*=-1;
  sort(a,a+n,greater<P>());
  cout << -a[0].second<<" "<<a[0].first<<endl;
  
  return 0;
}