#include <iostream>
using namespace std;

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	if(a == c and b == d) cout << "nijedan";
	else if(a == c and b != d) cout << "drugi";
	else if(a != c and b == d) cout << "prvi";
	else if(a != c and b != d) cout << "?";
	return 0;
}