#include <iostream>
using namespace std;

int main(){
	int n, a, v, maxa, maxv;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a >> v;
		if(v > maxv){
			maxv = v;
			maxa = a;
		}
	}
	cout << maxa << " " << maxv << endl;
	return 0;
}