#include <bits/stdc++.h>
using namespace std;
int a, b, x, y;
int main(){
    cin >> a >> b >> x >> y;
    if(a==x and b==y){
        cout << "nijedan";
        return 0;
    }
    if(x==a){
        cout << "drugi";
        return 0;
    }
    if(y==b){
        cout << "prvi";
        return 0;
    }
    cout << "?";
    return 0;
}