#include <iostream>
#include <vector>
#include <algorithm>

struct P {
    int x, y;
    bool operator<(const P& o) const {
        if (y == o.y) {
            return x < o.x;
        } else {
            return y > o.y;
        }
    }
};

using namespace std;

int main() {
    int n; cin >> n;
    vector<P> Ps;
    for (int i = 0; i < n; i++) {
        P p; cin >> p.x >> p.y;
        Ps.push_back(p);
    }
    sort(Ps.begin(), Ps.end());
    cout << Ps[0].x << ' ' << Ps[0].y << endl;
    return 0;
}