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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

int main()
{
    int n;
    cin >> n;
    
    pii ans(-1, -1);
    rep(i, n){
        pii t;
        cin >> t.second >> t.first;
        t.second *= -1;
        ans = max(ans, t);
    }
    
    cout << -ans.second << ' ' << ans.first << endl;
}