#include <bits/stdc++.h>
using namespace std;
int ar, br, ah, bh;
int main()
{
   cin >> ar >> br >> ah >> bh;
   if(ah == ar && bh == br)
      printf("nijedan\n");
   else if(ah == ar && bh < br)
      printf("drugi\n");
   else if(ah < ar && bh == br)
      printf("prvi\n");
   else printf("?\n");

   return 0;
}