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

int main() {

  vector< pair< long long int, long long int > > cnt;

  long long int n;
  cin >> n;

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

    long long int in0, in1;
    cin >> in0 >> in1;
    cnt.push_back( make_pair( -in1, in0 ) );

  }

  sort( cnt.begin(), cnt.end() );

  cout << cnt[0].second << " " << -cnt[0].first << endl;

  return 0;

}