#include <bits/stdc++.h>

using namespace std;
typedef pair<int, int> pii;

vector<pii> v;

int main() {
    int n;
    cin >> n;

    for (int i = 0; i < n; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        v.push_back(pii(-b, a));
    }

    sort(v.begin(), v.end());
    
    cout << v[0].second << " " << -v[0].first << endl;

    return 0;
}
