#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define all(x) x.begin(), x.end()
#define dbg(x) cout << (x) << "\n"
string s;

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

	if(a == x and b == y)
		dbg("nijedan");
	else
		if(a != x and b != y)
			dbg("?");
		else
			if(a == x)
				dbg("drugi");
			else
				if(b == y)
					dbg("prvi");


	return 0;
}