#include <iostream>
using namespace std;

int main() {
	int a, b, x, y;
	
	cin >> a >> b;
	cin >> x >> y;
	
	if (a < 0 || b < 0 || x < 0 || y < 0) return 0;
	else {
		if (a > x && b > y) cout << "?";
		else if (a == b) cout << "nijedan";
		else {
			if (a > b) cout << "prvi";
			else cout << "drugi";
		}
	}
	
	return 1;
}