#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;

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