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