#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<<"?";
}
else if(x<a and y==b){
    cout<<"prvi";
}
else if(x==a and y<b){
    cout<<"drugi";
}
else {
    cout<<"nijedan";
}
    return 0;
}