#include <bits/stdc++.h>

using namespace std;

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