#include<bits/stdc++.h>
using namespace std;
int a,b,x,y;
int main(){
  cin>>a>>b>>x>>y;
  if(y==b and x<a){
    cout<<"prvi";
  }
  else if(x==a and y<b){
    cout<<"drugi";
  }
  else if(x==a and y==b){
    cout<<"nijedan";
  }
  else{
    cout<<"?";
  }
return 0;
}