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