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

int main()
{
    int n, a, v;
    cin >> n;
    vector<pair<int, int> > vec;
    for (int i = 0; i < n; ++i) {
        cin >> a >> v;
        vec.push_back(make_pair(v, a));
    }
    vector<pair<int, int> >::iterator top =
        max_element(vec.begin(), vec.end());
    cout << top->second << " " << top->first << endl;
}