#include <iostream>

using namespace std;

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

    if (b == y && x < a)
        cout << "prvi" << endl;
    else if (a == x && y < b)
        cout << "drugi" << endl;
    else if (a == x && b == y)
        cout << "nijedan" << endl;
    else if (x < a && y < b)
        cout << "?" << endl;

    return 0;
}