#include <bits/stdc++.h>
int x,y,a,b;
using namespace std;
int main(){
    cin >> a >> b >> x >> y;
    if(a>x and b==y){
    cout << "prvi" <<endl;
}
else
    if(a>x and b>y and x!=y){
    cout << "?" <<endl;
}
else
    if(x==y and x!=a and y!=b){
    cout << "?" <<endl;
}
else
    if(a==x and b==y){
    cout << "nijedan" << endl;
}
else
    if(b>y and a==x){
    cout << "drugi" <<endl;
}
return 0;
}