#include <iostream>
using namespace std;
int main() {
	int a, b;
	cin >> a >> b;
	int x, y;
	cin >> x >> y;
	if (x < a) {
		if (y < b) {
			cout << "?" << endl;
		}
		else{
			cout << "prvi" << endl;
		}
	}
	else {
		if (y < b) {
			cout << "drugi" << endl;
		}
		else {
			cout << "nijedan" << endl;
		}
	}
}