#include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    int max=0; int kouho =0;
    for(int i=0;i<n;i++){
        int a,b;
        cin >> a >> b;
        if(max < b){
            max = b;
            kouho = a;
        }
    }
    cout << a << " " << b << endl;
}