#include <iostream>
using namespace std;

int main()
{
	int a, b, x, y;
	cin >> a >> b >> x >> y;
	x = a - x;
	y = b - y;

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