#include <iostream>
using namespace std;

int main(void){

  int n;
  int a[20];
  int v[100];
  int max = 0;
  int num = 0;

  cin >> n;

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

    cin >> a[i] >> v[i];

    if( max < v[i] ){
      
      max = v[i];
      num = a[i];
    }

  }

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

  return 0;

}