#include <iostream>

using namespace std;

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