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

return 0;
}