#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
    int a,b,x,y;
    cin >> a >> b >> x >> y;
    if(!(a-x) && !(b-y)){
        cout << "nijedan";
    }
    else if (!(a-x) && (b-y)){
        cout << "drugi";
    }
    else if ((a-x) && !(b-y)){
        cout << "prvi";
    }
    else{
        cout << "?";
    }
    return 0;
}