#include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int n;
  pair<int,int> num[105];
  int i;

  cin>>n;

  rep(i,n){
    cin>>num[i].second>>num[i].first;
    num[i].first*=-1;
  }
  sort(num,num+n);
  cout<<num[0].second<<" "<<-num[0].first<<endl;

}