#include <iostream>

using namespace std;

int a,b,x,y;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>a>>b;
    cin>>x>>y;
    if(a==x)
    {
        if(b==y)
            cout<<"nijedan";
        else
            cout<<"drugi";
    }
    else
    {
        if(b==y)
            cout<<"prvi";
        else
            cout<<"?";

    }

    return 0;
}