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

	if (x == a && y == b) {
		cout << "nijedan";
		return 0;
	}
	if (x == a && y != b) {
		cout << "drugi";
		return 0;
	}
	if (x != a && y == b) {
		cout << "prvi";
		return 0;
	}
	if (x != a && y != b) {
		cout << "?";
		return 0;
	}


}