#include <bits/stdc++.h>

using namespace std;
int a,b,x,y;
int main(){
   cin>>a>>b>>x>>y;
   int tim1=a-x;
   int tim2=b-x;
   if (tim1==0 and tim2>0) cout<<"drugi"<<endl;
   else if (tim1>0 and tim2==0) cout<<"prvi"<<endl;
   else if (tim1==0 and tim2==0) cout<<"nijedan"<<endl;
   else if (tim1>0 and tim2>0) cout<<"?"<<endl;

   return 0;
}