#include<iostream>
using namespace std;

int main()
{
    int n;
    int p[21] = {};

    cin >> n;

    int max = 0;
    for( int i = 1; i <= n; i++ )
    {
        cin >> p[i] >> p[i];
        if( max < p[i] )
            max = p[i];
    }
    
    for( int i = 1; i <= n; i++ )
    {
        if( p[i] == max )
        {
            cout << i << " " << max << endl;
            break;
        }
    }

    return 0;
}
