#include <iostream>
using namespace std;
void kojiCeBiti(int x,int y,int a,int b){
	if(x-a == 0 && y-b==0){
		cout << "nijedan";
	}
	else if(y-b == 0){
		cout << "prvi";
	}
	else if(x-a == 0){
		cout << "drugi";	
	}else{
		cout << "?";
	}
}

int main(){
	int x,y,a,b;
	cin >> x >> y >> a >> b;
	
	kojiCeBiti(x,y,a,b);
}