#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0);cin.tie(0);
	int a, b, x, y, p, d;
	
	cin >> a >> b;
	cin >> x >> y;
	
	p = a - x;
	d = b - y;
	
	if (p > 0 && d == 0) {
		cout << "prvi";
	} 
	else if (p == 0 && d > 0) {
		cout << "drugi";
	}
	else if (p == 0 && d == 0) {
		cout << "nijedan";
	}
	else if (p > 0 && d > 0) {
		cout << "?";
	}
	
	return 0;
}