#include <bits/stdc++.h>

using namespace std;

int x,y,a,b;

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