#include<iostream>
#include<string>
using namespace std;
int main(){
	int n,a[21],b,c,d=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>b>>c;
		a[b]=c;
		if(d<c)
			d=c;
	}
	int i=1;
	while(true){
		if(a[i]==d){
			cout<<i<<" "<<a[i]<<endl;
			break;
		}
		i++;
	}
    return 0;
}
 