#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"<<endl;
   }
   else if(a==x and y<b){
       cout<<"drugi"<<endl;
   }
   else if(a==x and b==y){
       cout<<"nijedan"<<endl;
   }
   else{
       cout<<"?"<<endl;
   }
    return 0;
}