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