#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

int main() {
    vector<pair<int,int>> w;
    int n;
    cin >> n;
    REP(i,n) {
        int a, v;
        cin >> a >> v;
        w.push_back(make_pair(100-v, a));
    }
    sort(w.begin(),w.end());
    cout << w[0].second << " " << 100-w[0].first << endl;
    return 0;
}