#include <iostream>

using namespace std;

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


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


    return 0;
}