#include <bits/stdc++.h>
using namespace std;
int a, b, x, y;

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