#include <bits/stdc++.h>

int main()
{
	uint64_t a, b, x, y;
	std::cin >> a >> b;
	std::cin >> x >> y;
	
	if(a == x && b == y)
		std::cout << "nijedan";
	else if(a > x && b > y)
		std::cout << "?";
	else if(a == x && b > y)
		std::cout << "drugi";
	else if(b == y && a > x)
		std::cout << "prvi";
	
	return 0;
}