#include <iostream>

using namespace std;

int main()
{
    int a,b,x,y;
    scanf("%d%d%d%d",&a,&b,&x,&y);
    if(x<a && y==b){
        cout<<"prvi";
    }else{
        if(x==a &&  y<b){
            cout<<"drugi";
        }else{
            if (x==a && y==b){
                cout<<"nijedan";
            }else{
                cout<<"?";
            }
        }
    }
}