#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	int a, b, x, y;
	cin>>a>>b>>x>>y;
	if(a==x and b==y){
		cout<<"nijedan";
	}
	else if(a==x){
		cout<<"drugi";
	}
	else if(b==y){
		cout<<"prvi";
	}
	else{
		cout<<"?";		
	}

	return 0;
}