#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int n, res[20][2];
    cin >> n;
    rep(i,n){
        cin >> res[i][0] >> res[i][1];
    }
    int max = 0, j;
    rep(i,n){
        if(max < res[i][1]){
            max = res[i][1];
            j = i;
        }
    }
    cout << res[j][0] << ' ' << res[j][1] << endl;
}