#include <iostream>

using namespace std;

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