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

int main() {
    int n;
    cin >> n;
    vector<pair<int,int>> list;
    for (int i=0; i<n; ++i) {
        int a, v;
        cin >> a >> v;
        list.push_back(make_pair(-v, a));
    }
    sort(list.begin(), list.end());
    cout << list[0].second << " " << -list[0].first << endl;
    return 0;
}