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