#include <iostream>

using namespace std;
int main()
{
	int a, b, x, y;
	cin >> a >> b;
	cin >> x >> y;

	if (x < a && y < b)
		cout << '?';

	if (x == a && y == b)
		cout << "nijedan";

	if (x < a)
		cout << 'prvi';

	if (y < b)
		cout << "drugi";
}