#include <iostream>
using namespace std;

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