#include <iostream>

using namespace std;

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