#include <iostream>
#include <string>
using namespace std;

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

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

	return 0;
}