#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;
int main(void){
  int n;
  scanf("%d",&n);
  pair<int,int> best = make_pair(0,0);
  for(int i = 0; i < n; i++){
    pair<int,int> p;
    scanf("%d %d",&p.second,&p.first);
    p.second *= -1;
    if(p > best) best = p;
  }
  printf("%d %d\n",-best.second,best.first);
}