#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;
	string konacan;
	cin>>a>>b>>x>>y;
	if(a==x and b>y){
		konacan="drugi";
	}
	else if(b==y and a>y){
		konacan="prvi";
	}
	else if(a==x and b==y){
		konacan="nijedan";
	}
	else{
		konacan="?";
	}
	cout<<konacan;
	return 0;
}