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