#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";return 0;}
        else
        {
            if((b-y)==0)
                cout<<"prvi";
            else
                cout<<"?";

            return 0;
        }
    }
    if((a-x)+(b-y)==0)
        cout<<"nijedan";
    return 0;
}