#include <bits/stdc++.h>
using namespace std;
int main(){
	long long a, b, x, y;
	scanf("%lld %lld %lld %lld", &a, &b, &x, &y);
	if(a == x && b == y)
		printf("nijedan");
	else if(a == x && b != y)
		printf("drugi");
	else if(a != x && b == y)
		printf("prvi");
	else
		printf("?");
	return 0;
}