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

void Predvidi()
{
	int a, b;//spojler
	int x, y;//poluvreme
	cin >> a >> b >> x >> y;
	if (a - x > 0)
	{
		if (b - y > 0)
			cout << "?";
		else
			cout << "prvi";
	}
	else if (b - y > 0)
	{
		if (a - x > 0)
			cout << "?";
		else
			cout << "drugi";
	}
	else if (a == x && b == y)
		cout << "nijedan";
}


int main()
{
	Predvidi();
	return 0;
}