#include<iostream>
using namespace std;
int rezultat(int a, int b, int x, int y)
{
	int xp = 0;
	int yp = 0;
	int rxp;
	int ryp;
	rxp = a - x;
	ryp = b - y;
	if(rxp > 0) xp = 1;
	if(ryp > 0) yp = 1;
	if(xp == 1 && yp == 0) return 1;
	else if(xp == 0 && yp == 1) return 2;
	else if(xp == 0 && yp == 0) return 3;
	else if(xp == 1 && yp == 1) return 4;
}
int main()
{
	int a, b, x, y;
	cin>>a>>b>>x>>y;
	int rez = rezultat(a, b, x, y);
	if(rez == 1) cout<<"prvi"<<endl;
	else if(rez == 2) cout<<"drugi"<<endl;
	else if(rez == 3) cout<<"nijedan"<<endl;
	else if(rez == 4) cout <<"?"<<endl;
}