#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
typedef pair<int, int> p;

void solve()
{
	int n;
	cin >> n;
	vector<p> list(n);
	for(int i = 0; i < n; ++i)
	{
		cin >> list[i].second >> list[i].first;
	}
	sort(list.begin(), list.end());
	cout << list[n - 1].second << " " << list[n - 1].first << endl;
}

int main()
{
	solve();
	return(0);
}