#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);

    int a, b, a1, b1;
    cin >> a >> b >> a1 >> b1;

    if(a == a1 and b == b1)
        cout << "nijedan" << endl;
    else if(a == a1 and b > b1)
            cout << "drugi" << endl;
        else if(a > a1 and b == b1)
                cout << "prvi" << endl;
            else if(a > a1 and b > b1)
                    cout << "?" << endl;
    
    return 0;
}