#include <iostream>

using namespace std;

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