#include <iostream>
using namespace std;

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