#include <bits/stdc++.h>
using namespace std;
int a,b,x,y;
int main(){
    scanf("%d%d", &a, &b);
    scanf("%d%d", &x, &y);

    if((a==x) and (b==y)){
        cout<<"nijedan"<<endl;
    }
    else if((b==y) and (a!=x)){
        cout<<"prvi"<<endl;
    }
    else if((a==x) and (b!=y)){
        cout<<"drugi"<<endl;
    }
    else{
        cout<<"?"<<endl;
    }


return 0;}