#include <iostream>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(0);
	int a, b, x, y;
	cin >> x >> y >> a >> b;
	if (a == x && b == y)
	{
		cout << "nijedan";
	} else if (a < x && b < y)
	{
		cout << "?";
	} else if (a == x && b < y)
	{
		cout << "drugi";
	} else if (b == y && a < x)
	{
		cout << "prvi";
	}
}