#include <bits/stdc++.h>
using namespace std;
struct Couple {
int x;
int y;
};
bool Compare(Couple lhs, Couple rhs) {
if (lhs.x < rhs.x) {
return true;
} else if (lhs.x == rhs.x && lhs.y < rhs.y) {
return true;
} else {
return false;
}
}
int main() {
int n;//n个数据对
int x;
int y;
//找到MinX,再在MinX里面找MinY
scanf("%d", &n);
Couple input[n];
for (int i = 0; i < n; ++i) {
scanf("%d%d", &input[i].x, &input[i].y);
}
for (int i = 0; i < n; ++i) {
sort(input, input + n, Compare);
}
printf("%d %d", input[0].x, input[0].y);
return 0;
}