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

int main(){
    int n;
    cin >> n;
    pair <int,int> data[20];
    for(int i=0;i<n;i++) {
        cin >> data[i].second >> data[i].first;
        data[i].second *= -1;
    }
    sort(data,data + n);
    cout << -data[n-1].second << " " <<  data[n-1].first << endl;
}