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

int main(){
  int n,a[100],v[100],i,num,top;
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a[i] >> v[i];
  }
  top=v[0];
  for(i =  1;i<n;i++){
    if(top<v[i]){
top=v[i];
num=a[i];
  }
  }

  cout << num<<" "<<top<<endl;
  
  return 0;
}