#include <iostream>
#include <vector>
#include <algorithm>
using std::cout;
using std::cin;
using std::endl;
using std::stable_sort;
using std::vector;
typedef struct pair{
int x;
int y;
}Pair;
bool cmp(Pair p1, Pair p2){
if(p1.x == p2.x)
return p1.y <= p2.y;
return p1.x <= p2.x;
}
int main()
{
int n;
vector<Pair> vec;
while(cin >> n){
for(int i = 0; i < n; i++){
Pair p;
cin >> p.x >> p.y;
vec.push_back(p);
}
stable_sort(vec.begin(),vec.end(),cmp);
cout << vec[0].x << ' ' << vec[0].y << endl;
}
return 0;
}