#include <iostream>
#include <utility>
#include <algorithm>
#include <functional>

using namespace std;

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

    return 0;
}