#include <iostream>

using namespace std;

int main()
{
    unsigned short a, b, x, y;
    cin >> a >> b >> x >> y;
    a -= x;
    b -= y;
    if ( a == 0 && b == 0)
        cout << "nijedan";
    else if( a == 0 && b > 0 )
        cout << "drugi";
    else if ( a > 0 && b == 0 )
        cout << "prvi";
    else cout << "?";
    return 0;
}