#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;

int main(){
	int n,mina = INF,minb = INF,a,b;
	cin>>n;
	while(n--){
		cin>>a>>b;
		if(a < mina){
			mina = a;
			minb = b;
		}else if(a == mina && b < minb){
			minb = b;
		}
	}
	cout<<mina<<" "<<minb<<endl;

}