#include <iostream>
using namespace std;

int main()
{
    int a, b, x, y;
    cin >> a;
    cin >> b;
    cout << "\n";
    cin >> x;
    cin >> y;
    if (a == x)
    {
        if (b == y)
            cout << "nijedan";
    }
    else
    {
        if (b == y)
            cout << "prvi";
        else
            cout << "?";
    }
    if (a == x && b != y)
        cout << "drugi";
}