#include <iostream>

using namespace std;

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