#include<iostream>
using namespace std;
int main(){
    int a,b,x,y;
    cin>>a>>b>>x>>y;
    a-=x;
    b-=y;
    if(a){
        if(b)
            cout<<'?';
        else
            cout<<"prvi";
    }else{
        if(b)
            cout<<"drugi";
        else
            cout<<"nijedan";
    }
    return 0;}