#define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){
	
	int n;
	cin>>n;
	int maxa,maxb;
	
	int a,b;
	
	cin>>a>>b;
	
	maxa=a;
	maxb=b;
	
	for(int i=1;i<n;i++){
		cin>>a>>b;
		if(maxb<b){
			maxb=b;
			maxa=a;
		}
	}
	
	cout<<maxa<<" "<<maxb<<endl;
	



}