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

int main() {
  int n;
  pair<int,int> ans(1,0);
  cin >> n;
  while(n--) {
    int a, v;
    cin >> a >> v;
    ans = min(ans, make_pair(-v, a));
  }
  cout << ans.second << " " << -ans.first << endl;
  return 0;
}