#include <iostream>
#include <cstdio>
using namespace std;

typedef struct{
	int a;
	int v;
}member;

int main(){
	int n, max=0;
	member m[20];
	
	cin >> n;
	for(int i=0; i<n; ++i){
		scanf(" %d %d", &m[i].a, &m[i].v);
		if(max < m[i].v) max=m[i].v;
	}

	for(int i=0; i<n; ++i){
		if(max==m[i].v){
			printf("%d %d\n", m[i].a, m[i].v);
			break;
		}
	}

	return 0;
}