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

   return 0;
}