#include<bits/stdc++.h>

using namespace std;

int main(){
    int x, y, a, b;

    cin >> x >> y >> a >> b;

    if(x == a and y == b){
        cout << "nijedan\n";
        return 0;
    }
    if(x == a){
        cout << "drugi\n";
        return 0;
    }
    if(y == b){
        cout << "prvi\n";
        return 0;
    }
    cout << "?\n";
    return 0;
}