#include<bits/stdc++.h>
using namespace std;
int main(){

    int a,b,x,y;
    cin>>a>>b;
    cin>>x>>y;

    if(a==x){

        if(b==y){

            cout<<"nijedan";
        }
        else{

            cout<<"drugi";
        }

    }
    else{
        if(b==y){

            cout<<"prvi";
        }
        else{

            cout<<"?";
        }
    }

}