#include<bits/stdc++.h>
using namespace std;
int main(){
	int a, b, x, y;
	cin>>a>>b>>x>>y;
	if(a>x && b==y)cout<<"prvi\n";
	if(a==x && b>y)cout<<"drugi\n";
	if(a==x && b==y)cout<<"nijedan\n";
	if(a>x && b>y)cout<<"?\n";
}