#include <iostream>

using namespace std;

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