#include <iostream>

using namespace std;

int main()
{
    int a, b, a1, b1;
    cin>> a >> b >> a1 >> b1;
    if(a == a1){
        if(b == b1)
        {
            cout << "nijedan" << endl;
        }
        else
        {
            cout << "drugi" << endl;
        }
    }
    else if(b == b1){
        cout << "prvi" << endl;
    }
    else{
        cout << "?" << endl;
    }
    return 0;
}