#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
using namespace std;

double dp[2001][2001];

int main(){
	int N,A,B,ans1,ans2=0;
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>A>>B;
		if(B>ans2){
			ans1 = A; ans2 = B;
		}
	}
	printf("%d %d\n",ans1,ans2);
	return 0;
}