#include <iostream>

using namespace std;

int main()
{
	int n, a, v, maxa = 0, maxv = 0;

	cin >> n;

	for (int i=0; i<n; i++)
	{
		cin >> a >> v;

		if(v > maxv){
			maxa = a;
			maxv = v;
		}
	}

	cout << maxa << ' ' << maxv << endl;

	return 0;
}