#include <cstdio>
#include <utility>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
	int n, a, b;
	scanf("%d", &n);
	vector<pair<int,int> > v(n);
	for(int i = 0; i < n; ++i){
		scanf("%d%d", &a, &b);
		v[i].first = b;
		v[i].second = -a;
	}

	const pair<int,int> &p = *max_element(v.begin(), v.end());
	printf("%d %d\n", -p.second, p.first);
}