#include <iostream>
using namespace std;
int main()
{
	unsigned long long x, y, a, b;
	cin >> a >> b >> x >> y;
	if (x == a)
	{
		if (y == b)
			cout << "nijedan";
		else
			cout << "drugi";
		return 0;	
	}
	if (y == b)
		cout << "prvi";
	else
		cout << "?";
}