#include <iostream>
using namespace std;
int main()
{
    int a, b, x, y, raz1, raz2;
    cin >> a >> b;
    cin >> x >> y;
    raz1 = a - x;
    raz2 = b - y;
    if (raz1 == 0 && raz2 == 0)
        cout << "nijedan" << endl;
    else if (raz1 == 0)
        cout << "drugi" << endl;
    else if (raz2 == 0)
        cout << "prvi" << endl;
    else
        cout << "?" << endl;
    return 0;
}