#include <bits/stdc++.h>
using namespace std;
long long a,b,c,d;
int main(){
    cin>>a>>b>>c>>d;
    if(c==a and b==d) cout<<"nijedan"<<endl;
    else if(c==a and b>d)cout<<"drugi"<<endl;
    else if(a>b and b==d)cout<<"prvi"<<endl;
    else cout<<"?"<<endl;

    return 0;
}