#include <iostream>

using namespace std;

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