#include <iostream>

using namespace std;

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

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

    return 0;
}