#include <iostream>

using namespace std;

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