#include <iostream>

using namespace std;

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