#include <stdio.h>

int main(void)
{
	int n;
	int a[20];
	int v[20];
	int b;
	int i;
	int max;
	
	scanf("%d", &n);
	
	max = 0;
	for (i = 0; i < n; i++){
		scanf("%d %d", &a[i], &v[i]);
		if (max < v[i]){
			max = v[i];
			b = a[i];
		}
	}
	
	for (i = 0; i < n; i++){
		if (max == v[i]){
			printf("%d %d\n", b, v[i]);
			break;
		}
	}
	
	return(0);
}