#include<stdio.h>
int main(void)
{
	int n;
	int a[21],v[101];
	int i;
	int max=0,m;

	while(scanf("%d",&n)!=EOF){
		for(i=0;i<n;i++){
			scanf("%d %d",&a[i],&v[i]);
			if(max<v[i]){
				max=v[i];
				m=a[i];
			}
		}
		printf("%d %d\n",m,max);
	}
	return 0;
}