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