#include<bits/stdc++.h>
using namespace std;
int a, b, x, y;
int main() {
	cin >> a >> b >> x >> y;
	if (a == x) {
		if (b == y) {
			cout << "nijedan";
		}
		if (b != y) {
			cout << "drugi";
		}
	}
	if (a != x) {
		if (b == y) {
			cout << "prvi";
		}
		if (b != y) {
			cout << "?";
		}
	}
	return 0;
}