#include <iostream>
#include <algorithm>
using namespace std;
struct Pair{
    int a;
    int b;
};
bool cmp (Pair x,Pair y)
{
    if(x.a==y.a)
    {
        return x.b<y.b;
    }
    else{
        return x.a<y.a;
    }
}
int main() {
    int n;
    while (cin >> n) {
        Pair p[n+1];
        for(int i=1;i<=n;i++)
        {
            cin>>p[i].a>>p[i].b;
        } 
        sort(p+1,p+n+1,cmp);
        cout<<p[1].a<<" "<<p[1].b<<endl;
    }
}