#include <iostream>
int main(){
	std::ios::sync_with_stdio(false);
	int a, b, x, y;
	std::cin >> a >> b >> x >> y;
	if(a==x){
		if(b==y) std::cout << "nijedan\n";
		else std::cout << "drugi\n";
	}
	else if(b==y) std::cout << "prvi\n";
	else std::cout << "?\n";
}