#include <iostream>
using namespace std;

int main(void){

  int n;
  int max = 0;
  int num = 0;

  cin >> n;

  for( int i = 0 ; i < n ; i++ ){

    int a=0,v=0;

    cin >> a >> v;

    if( max < v ){
      
      max = v;
      num = a;

    }

  }

  cout << num << " " << max << endl;

  return 0;

}