#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define LPRINT(a, b) for (auto&(a) : (b))
#define li(i,a,b) for (int (i) = (a); (i) < (b); (i)++)
#define lij(i,a,b) for (int (i) = (a); (i) <= (b); (i)++)

int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);

int a,b,x,y;
cin>>a>>b>>x>>y;

if(a==x && b==y){
	cout<<"nijedan";
}
else if(a>x && b==y){
	cout<<"prvi";
}
else if(a==x && b>y){
	cout<<"drugi";
}
else{
	cout<<"?";
}
return 0;
}