#include <iostream>

using namespace std;

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