#include <iostream>

using namespace std;

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