#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<double,int> p;

int main(){
    vector<p> v;
    int n,num,data,m;
    
    cin >> n;
    m = n;
    while(n--){
        cin >> num >> data;
        v.push_back(p(data,num));
    }
    stable_sort(v.begin(),v.end());
    cout << v[m-1].second << ' ' << v[m-1].first << endl;
    
    return 0;
}