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



int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    int a,b, x ,y;
    cin >> a >> b >> x >> y;
    if((a+b) == (x+y))  cout << "nijedan";
    else if(x < a){
        if(y < b) cout << "?";
        else cout << "prvi";
    }
    else if (y < b){
        cout << "drugi";
    }

    return 0;
}