#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<int,pair<int,int> > P;
int main(void){
  pair<int,pair<int,int> > p;
  vector<P> v;
  int n,a,b;
  cin >> n;
  for(int i = 0;i < n; i++){
    cin >> p.second.second >> p.first;
    p.second.first = 100 - p.second.second;
    v.push_back(p);
  }
  sort(v.begin(),v.end());
  cout << v[v.size()-1].second.second << " " << v[v.size()-1].first << endl;
}
