#include <stdio.h>

int main()
{
	int a, b, x, y;
	scanf("%i%i%i%i", &a, &b, &x, &y);
	
	if(x < a && y < b)
		printf("?\n");
	if(x == a && y == b)
		printf("nijedan\n");
	if(x < a && y == b)
		printf("prvi\n");
	if(x == a && y < b)
		printf("drugi\n");
	return 0;
}