#include <iostream>

using namespace std;

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