#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int N = 1e6 + 10;
int t, n, m, k, l, r, op, x, y;
int f[N];
priority_queue<pii,vector<pii>,greater<pii>>pq;
void solve() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> x >> y;
pq.push({x, y});
}
auto&[x, y] = pq.top();
cout << x << " " << y;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}