#include <iostream>

using namespace std;

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