#include <iostream>
#include <iomanip>
using namespace std;

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