#include<iostream>

using namespace std;

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