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

int main(){
  int n;
  cin >> n;
  vector<pair<int,int> > p(n, pair<int,int>(0,0));
  for (int i = 0; i < n; i++){
    cin >> p[i].second >> p[i].first;
    p[i].second = -p[i].second;
  }
  sort(p.begin(), p.end(), greater<pair<int,int> >());
  cout << (-p[0].second) << ' ' << p[0].first << endl;
}