#include <iostream>
using namespace std;

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