#include<vector>
#include<iostream>
using namespace std;
int main(){
	int N,x,y,ans1,ans2=-1;
	cin >> N;
	while(N--){
		cin >> x >> y;
		if(y>ans2){
				ans1 = x;
				ans2 = y;
		}
	}
	cout << ans1 << ' ' << ans2 << endl;
	return 0;
}
