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

 return 0;
}