#include<cstdio>
#include<algorithm>

using namespace std;
struct zhengshu {
    int x;
    int y;
};
bool comp(zhengshu lhs, zhengshu 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;
    zhengshu arr[1000];
    while (scanf("%d", &n) != EOF) {
        for (int i = 0 ; i < n ; ++ i) {
            scanf("%d%d\n", &arr[i].x, &arr[i].y);
        }
        sort(arr, arr + n, comp);
        printf("%d %d\n", arr[0].x, arr[0].y);

    }
    printf("\n");
}