#include <bits/stdc++.h>
using namespace std;

int x, y, a, b;

int main()
{
   cin >> a >> b >> x >> y;

   if(x == a and y == b)
      cout << "nijedan"<< endl;
   else if(x == a and y < b)
      cout << "drugi" << endl;
   else if(x < a and y == b)
      cout << "prvi" << endl;
   else
      cout << "?" << endl;
   return 0;
}