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

int main(){
    int n;
    cin >> n;
    vector< pair<int, int> > ls(n);
    for(int i = 0; i < n; i++){
        cin >> ls[i].second >> ls[i].first;
    }
    sort(ls.begin(), ls.end());
    cout << ls[n-1].second << ' ' << ls[n-1].first << endl;
    return 0;
}