#include "bits/stdc++.h"
#define ll long long
#define pb push_back
using namespace std;



void solve() {
    ll a,b,x,y;
    cin>>a>>b;
    cin>>x>>y;
    if(a>x&&b>y){
        cout<<'?'<<endl;
    }
    else if(a==x&&b==y){
        cout<<"nijedan"<<endl;
    }
    else if(a>x&&b==y){
        cout<<"prvi"<<endl;
    }
    else
        cout<<"drugi"<<endl;
}

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int t=1;
    /*
    cin>>t;
    //*/
    while(t--) {
        solve();
    }
}