#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if(a==c && b==d){
		cout<<"nijedan"<<endl;
		return 0;
	}
	if(a==c){
		cout<<"drugi"<<endl;
		return 0;
	}	
	if(b==d){
		cout<<"prvi"<<endl;
		return 0;
	}
	cout<<"?"<<endl;
	return 0;
}