#include <bits/stdc++.h>
using namespace std;

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

    return 0;
}