#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>


using namespace std;
const int MOD = 1000000009; // check!!!
const int INF = 100000000; //1e8

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)(c).size())
#define ten(x) ((int)1e##x)
#define tenll(x) ((ll)1e##x)

struct P{
	int x,y;
	P(){}
	P(int x,int y) : x(x),y(y){}
	bool operator <(const P& p) const { return y != p.y ? y > p.y : x < p.x; }
};

int main(){
	int n; cin>>n;
	vector<P> v(n);
	FOR(i,n) cin>>v[i].x>>v[i].y;
	sort(v.begin(),v.end());
	printf("%d %d\n",v[0].x,v[0].y);

	return 0;
}