#include <bits/stdc++.h>

using namespace std;

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

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

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

    return 0;
}