#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<int,int> p;
 
int main(){
    vector<p> v;
    int n,data,num;
     
    cin >> n;
    for(int i = 0 ; i < n ; i++){
      cin >> num >> data;
      v.push_back(p(-data,num));
    }
    stable_sort(v.begin(),v.end());
    cout << v[0].second << ' ' << (-1)*v[0].first << endl;

    return 0;
}