#include <cstdio>
#include <algorithm>

using namespace std;

int main(){
	int n;
	int a, b;
	int v[110] = {0}, v2[110] = {0};
	
	scanf("%d", &n);
	
	for (int i = 1; i <= n; i++){
		scanf("%d %d", &a, &b);
		v[a] = b;
		v2[a] = b;
	}
	
	sort(v, v + n);
	reverse(v, v + n);
	
	for (int i = 0; i < n; i++){
		if (v2[i] == v[0]){
			printf("%d %d\n", i, v2[i]);
			break;
		}
	}
}