#include<bits/stdc++.h>
using namespace std;
int a,b,c,d;
int main(){
    cin>>a>>b>>c>>d;
    if(a==c and b==d){
        cout<<"nijedan"<<endl;
    }
    else if(a==c and b>d){
        cout<<"drugi"<<endl;
    }
    else if(a>c and b==d){
        cout<<"prvi"<<endl;
    }
    else{
        cout<<"?"<<endl;
    }
return 0;
}