#include <iostream>

using namespace std;

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