#include <iostream>
using namespace std;

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