#include <iostream>

using namespace std;
int main() {
    int a,b,x,y;
    cin>>a>>b>>x>>y;

    if (a==x)
    {
        if (b==y)
        {
            cout<<"nijedan";//a==x b==y
        }
        else if (b>y)
        {
            cout<<"drugi";//a==x b>y
        }
        
    }
    else if (b==y)
    {
        if (a>y)
        {
            cout<<"prvi";//b==y a>y
        }
    }
    else{
        cout<<"?";//a!=x b!=y
    }
}