#include <iostream>

using namespace std;

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