#include <iostream>
#include <algorithm>
using namespace std;


int main()
{
	int a, b;
	int x, y;

	std::cin >> a >> b;
	std::cin >> x >> y;

	x = a - x;
	y = b - y;

	if (x == 0)
	{
		if (y == 0)
			cout << "nijedan";
		else
			cout << "drugi";
	}
	else
		if (y == 0)
			cout << "prvi";
		else
			cout << "?";
		
	
 	return 0;
}