#include<iostream>

using namespace std;

int main(){
  int A,B=-1;

  int n;
  cin >> n;
  while(n--){
    int a,b;
    cin >> a >> b;

    if(B < b || B == b && A > a){
      A = a;
      B = b;
    }
  }
  cout << A << " " << B << endl;

  return 0;
}