#include <iostream>
using namespace std;
 
struct person {
    int a;
    int v;
};
int main() {
    struct person man[25],max;
    max.a=max.v=-1;
    int n;
    cin>>n;
    while(n--){
        cin>>man[n].a>>man[n].v;
        if(max.v<man[n].v)max=man[n];
    }
    cout<<max.a<<" "<<max.v<<endl;
     
    return 0;
}