#include <bits/stdc++.h>

using namespace std;

int main()
{
  typedef pair<int, int> P;
  int n; cin >> n;
  vector<P> av(n);
  for(P &p : av) cin >> p.second >> p.first, p.first *= -1;
  sort(av.begin(), av.end());
  cout << av[0].second << " " << -av[0].first << endl;
  return 0;
}