#include <iostream>

using namespace std;

int main()
{
    int a,b;
    int x,y;

    cin>>a>>b;
    cin>>x>>y;

    if((a-x)+(b-y)>1){
        if((a-x)==0)
            cout<<"drugi";
        else
        {
            if((b-y)==0)
                cout<<"prvi";
            else
                cout<<"?";
        }
    }
    if((a-x)+(b-y)==0)
        cout<<"nijedan";
    if((a-x)+(b-y)==1){
        if((a-x)>(b-y))
            cout<<"prvi";
        else
            cout<<"drugi";
    }
    return 0;
}