#include <iostream>

using namespace std;

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