#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 << "?" << endl;
    else if (raz1 == 0 && raz2 == 0)
        cout << "nijedan" << endl;
    else if (raz1 == 0)
        cout << "drugi" << endl;
    else
        cout << "prvi" << endl;
    return 0;
}