#include<bits/stdc++.h>
using namespace std;
int a,b,x,y;
int main (){
    cin>>a>>b;
    cin>>x>>y;

    if (x==a){
        if (y==b){
            cout<<"nijedan";
        }
        if(y<b){
            cout<<"drugi";
        }
    }
    if (y==b){
        if (x<a){
            cout<<"prvi";
        }
    }
    if(x<a and y<b){
        cout<<"?";
    }




return 0;
}