#include <iostream>

using namespace std;

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

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

    return 0;
}