#include <iostream>

using namespace std;
string solve(int a, int b, int x, int y)
{
    if(a==x && b==y)
    {
        return "nijedan";
    }
    if(a==x && b>y)
    {
        return "drugi";
    }
    if(b==y && a>x)
    {
        return "prvi";
    }
    if(a>x && b>y)
    {
        return "?";
    }
}
int main()
{
    int a,b;
    cin>>a>>b;
    int x,y;
    cin>>x>>y;

    cout<<solve(a,b,x,y);

    return 0;
}