#include <iostream>

using namespace std;

int main(void){
    int a,b;
    int x,y;
    cin >>a>>b>>x>>y;
    if(a>x&&b==y){
        cout<<"prvi"<<endl;
    }else if(a>x&&b>y){
        cout<<"?"<<endl;
    }else if(a==x&&b>y){
        cout<<"drugi"<<endl;
    }else if(a==x&&b==y){
        cout<<"nijedan"<<endl;
    }
    return 0;
}