#include<iostream>
using namespace std;
int main() {
	int n;
	cin >> n;
	int maxn, maxs;
	cin >> maxn >> maxs;
	for (int i = 0; i < n - 1; i++){
		int a, b; cin >> a >> b;
		if (maxs < b){
			maxn = a;
			maxs = b;
		}
	}
	cout << maxn <<' '<< maxs << endl;
}