#include <iostream>
using namespace std;

int main()
{
	int spoiled1, spoiled2, real1, real2;
	cin >> spoiled1 >> spoiled2 >> real1 >> real2;

	string output;

	if (spoiled1 == real1 && spoiled2 == real2)
	{
		output = "nijedan";
	}

	if (spoiled1 > real1) 
	{
		if (spoiled2 == real2)
		{
			output = "prvi";
		}
		
		if (spoiled2 > real2)
		{
			output = "?";
		}
	}

	if (spoiled2 > real2)
	{
		if (spoiled1 == real1)
		{
			output = "drugi";
		}

		if (spoiled1 > real1)
		{
			output = "?";
		}
	}

	cout << output;
}