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