#include<bits/stdc++.h>
using namespace std;
int n;
static const int maxn=1e5+5;
vector<pair<int,int> > solve;
//根据题目定义的规则函数
bool cmp(pair<int,int> a, pair<int,int> b)
{
if( a.first!=b.first )
{
return a.first<b.first;
}
else
{
return a.second<b.second;
}
}
int main()
{
while( ~scanf("%d",&n) )
{
for(int i=0; i<n; ++i)
{
pair<int,int> temp;
scanf("%d%d",&temp.first,&temp.second);
solve.push_back( temp );
}
sort( solve.begin(), solve.end(), cmp);
printf("%d %d\n",solve[0].first, solve[0].second);
}
return 0;
}