#include <iostream>
using namespace std;

int main() {
	int n, nf, num , mnf, mnum;

	cin >> n;
	cin >> mnum >> mnf; n--;
	while (n--) {
		cin >> num >> nf;
		if (nf > mnf) {
			mnf = nf;
			mnum = num;
		}
	}
		cout << mnum << " " << mnf << endl;

		return 0;
	}