#include <iostream>

using namespace std;

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