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