#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) x.begin(), x.end()
#define pf push_front
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define sz(x) (int)x.size()
#define f first
#define s second
#define mod 1000000007
#define inf 1e9
#define linf 1e18
// const int mod = 998244353;
// OVERFLOW!!!!!!!!!!!!!!!!!!
int main()
{
   ios_base::sync_with_stdio(false);
   cout.tie(nullptr);
   cin.tie(nullptr);

   int a, b, x, y;
   cin >> a >> b >> x >> y;
   if (a == x && b > y)
      cout << "drugi";
   else if (b == y && a > x)
      cout << "prvi";
   else if (a == x && b == y)
      cout << "nijedan";
   else
      cout << "?";
   return 0;
}