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

int main(){

  int n;
  int a,b;
  int z[1000][1000] = {0};

  cin >> n;

  for(int i=0;i<n;i++){
    cin >> a >> b;
    z[b][a] = 1;
  }

  for(int i=100;i>=0;i--){
    for(int j=1;j<=20;j++){
      if(z[i][j] == 1){
	cout << j << " " << i << endl;
	return 0;
      }
    }
  }

}