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

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