#include<stdio.h>
int main(){
	int a,b,x,y;
	scanf("%d %d",&a,&b);
	scanf("%d %d",&x,&y);
	if(x==a and y<b)printf("drugi");
	else if(x<a and y==b)printf("prvi");
	else if(x==a and y==b)printf("nijedan");
	else printf("?");
	return 0;
}