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

int main(void){
  int n, a,f;
  vector<pair<int, int> > v;
  
  cin >> n;
  for (int i=0; i<n; i++){
    cin >> a >> f;
    v.push_back(make_pair(-f, a));
  }
  sort(v.begin(), v.end());
  cout << v[0].second << " " << -v[0].first << endl;
  
  return 0;
}
  
  

