#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;

int main(){
	int person[20], fish[20];
	int n;
	int array[20];

	cin >> n;
	for(int i=0; i < n; i++){
		cin >> person[i] >> fish[i];
		array[i] = fish[i];
	}
	sort(array, array+n, greater<int>());

	for(int i=0; i < n; i++){
		if(array[0] == fish[i]){
			cout << person[i] << " " << fish[i] << endl;
		}
	}




}