#include<stdio.h>

int main(){
	long int a,b,x,y;
	
	scanf("%ld%ld",&a,&b);
	scanf("%ld%ld",&x,&y);
	
	if(a==x && b==y)
		printf("nijedan");
		
	else if(a>x && b>y)
		printf("?");
		
	else if(a==x && b>y)
		printf("drugi");
	
	else if(a>x && b==y)
		printf("prvi");
		
	return 0;
}