#include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
struct xy{
    int x;
    int y;
};
bool compare(xy lhs,xy rhs){
    if(lhs.x<rhs.x){
        return true;
    }else if(lhs.x==rhs.x){
        if(lhs.y<rhs.y){
            return true;
        }
        else{
            return false;
        }
    }else{
        return false;
    }
}
int main(){
    int n,x,y;
    scanf("%d",&n);
    vector<xy> min(n);
    for(int i=0;i<n;++i){
        scanf("%d %d",&min[i].x,&min[i].y);
    }
    sort(min.begin(),min.end(),compare);
    printf("%d %d",min[0].x,min[0].y);
    return 0;
}