//
//  main.cpp
//  ggggggggggggggggggggggggggggggggggggg
//
//  Created by h3037175 on 2017/08/01.
//  Copyright ?? 2017??´ h3037175. All rights reserved.
//

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