#include <iostream>
using namespace std;
int main()
{
	int a, b, x, y;
	cin >> a >> b >> x >> y;
	a -= x; b -= y;
	if (a > 0 && b == 0) cout << "prvi";
	else if (a == 0 && b > 0) cout << "drugi";
	else if (a == 0 && b == 0) cout << "nijedan";
	else cout << "?";
}