#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

const int MAX=1000;

struct Numbers{
    int x;
    int y;
};

Numbers arr[MAX];

bool Compare(Numbers a,Numbers b){
    if(a.x==b.x){
        return a.y<b.y;
    }else{
        return a.x<b.x;
    }
}

int main() {
    int n;
    while(scanf("%d",&n)!=EOF){
        for(int i=0;i<n;i++){
            cin>>arr[i].x>>arr[i].y;
        }
        sort(arr,arr+n,Compare);
        cout<<arr[0].x<<" "<<arr[0].y<<endl;
    }
    return 0;;
}
// 64 位输出请用 printf("%lld")