#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second

using namespace std;

int a, b, x, y;

int main()
{
   cin >> a >> b >> x >> y;
   if(a==x && b==y) cout << "nijedan\n";
   else if(a==x && b>y) cout << "drugi\n";
   else if (b==y && a>x) cout << "prvi\n";
   else cout << "?\n";
}