#include<iostream>
#include<algorithm>
//#include<fstream>
using namespace std;
struct NewNum{
int x;
int y;
bool operator <(const NewNum & anum)const
{
if(x == anum.x)
{
return y < anum.y;
}
return x < anum.x;
}
};
NewNum nums[1001];//记录数据对
int main()
{
int n;//记录输入n对整数
//ifstream cin("BUPT_1170.txt");
while(cin >> n)
{
for(int i=0; i< n; i++)
{
cin >> nums[i].x >> nums[i].y;
}
sort(nums,nums+n);
cout << nums[0].x << " " << nums[0].y << endl;
}
return 0;
}
/**************************************************************
Problem: 1170
User: itswyy
Language: C++
Result: Accepted
Time:10 ms
Memory:1528 kb
****************************************************************/