#include <iostream>

using namespace std;

int main()
{
    int a, b, x, y, n, nn;
    cin >> a;
    cin >> b;
    cin >> x;
    cin >> y;

    n=0;
    nn=0;

    n = a - x;
    nn = b - y;

    if (n==0 || nn==0){
        if (n>nn)
            cout <<"prvi";
        if (nn>n)
            cout <<"drugi";
        if (n==nn)
            cout <<"nijedan";
    }
    else
        cout <<"?";
    return 0;
}