#include <iostream>

using namespace std;

int main()
{
    int a,b,x,y,A,B;
    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<<"?";
    return 0;
}