#include<bits/stdc++.h>
using namespace std;

int main(){

    int a1, a2, b1, b2;
    cin>>a2>>b2>>a1>>b1;

    if(a1 != a2 && b1 != b2){
        cout<<"?"<<endl;
    }
    else{

        if(a1 == a2 && b1 != b2){
            cout<<"drugi"<<endl;
        }
        if(a1 != a2 && b1 == b2){
            cout<<"prvi"<<endl;
        }
        if(a1 == a2 && b1 == b2){
            cout<<"nijedan"<<endl;
        }
    }
}