#include <iostream>

using namespace std;

int main()
{
    int a, b, x, y, r1, r2;
    cin >> a >> b;
    cin >> x >> y;
    r1 = a - x;
    r2 = b - y;
    if(r1 == 0 && r2 == 0)
    {
        cout << "nijedan";
    }
    else if(r1 == 0 && r2 != 0)
    {
        cout << "drugi";
    }
    else if(r1 != 0 && r2 == 0)
    {
        cout << "prvi";
    }
    else
    {
        cout << ("?");
    }
    return 0;
}