#include <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

int main()
{
	int maxF = 0, winNum = 0;
	int n;
	int get, num;
	scanf("%d", &n);
	loop(i, 0, n)
	{
		scanf("%d%d", &num, &get);
		if( maxF < get )
		{
			winNum = num;
			maxF = get;
		}
	}
	printf("%d %d\n", winNum, maxF);
	return (0);
}