#include <iostream>

using namespace std;

void nextGoal(unsigned a, unsigned b, unsigned x, unsigned y)
{
    if(a==x)
       if(b>y)
          cout<<"drugi"<<endl;
       else
          cout<<"nijedan"<<endl;
    else if(b>y)
          cout<<"?"<<endl;
         else
          cout<<"prvi"<<endl;
}

int main()
{
    unsigned a, b, x, y;
    cin>>a>>b;
    cin>>x>>y;
    nextGoal(a, b, x, y);
    return 0;
}