#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	int x,y,a,b;
	cin >> a >> b >> x >> y;
	if(x<a&&y<b)
	{
		cout << "?";
	}
	else if(x<a&&!y<b)
	{
		cout << "prvi";
	}
	else if(!x<a&&y<b)
	{
		cout << "drugi";
	}
	else 
	{
		cout << "nijedan";
	}
	
	return 0;
}