#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define int long long

void solve(){
	int a, b, c, d;
	cin >> c >> d >> a >> b;
	if(a==c && b==d){
		cout << "nijedan\n";
	}
	else if(c>a && d>b){
		cout << "?\n";
	}
	else if(c>a && d==b){
		cout << "prvi\n";
	}
	else if(d>b && c==a){
		cout << "drugi\n";
	}
}

signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin >> t;
	while(t--){
		solve();
	}
	
}