#include <iostream>
using  namespace std;

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

}