#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <time.h>
#include <cstdio>
using namespace std;
int main(){
	int n;
	cin >> n;
	vector< pair<int,int> > v;
	for(int i = 0 ; i < n ; i++){
		int a,b;
		cin >> a >> b;
		v.push_back(make_pair(-b,a));
	}
	sort(v.begin(),v.end());
	cout << v[0].second << " " << v[0].first * (-1) << endl;
}