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

typedef pair<int, int> P;

int main(){
  vector<P> v;
  int n;
  cin >> n;
  P t;
  for(int i = 0 ; i < n ; i++){
    cin >> t.second >> t.first;
    v.push_back(t);
  }

  sort(v.rbegin(), v.rend());
  cout << v[0].second << ' ' << v[0].first << endl;
  return 0;
}