#include <iostream>
#include <utility>

using namespace std;

int main()
{
  pair<int, int> perf[20], max;
  int i, n;

  cin >> n;
  for (i = 0; i < n; i++) {
	cin >> perf[i].first >> perf[i].second;
  }

  max = perf[0];
  for (i = 1; i < n; i++) {
    if ((max.second < perf[i].second) || 
        (max.second == perf[i].second && max.first > perf[i].first)) {
      max = perf[i];
    }
  }

  cout << max.first << " " << max.second << endl;

  return 0;
}