#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;
int a, b, x, y;
int main(){
    cin >> a >> b;
    cin >> x >> y;
    
    if(x == a and y == b){
        cout<<"nijedan"<<endl;
    }
   else if(x < a and y == b){
       cout<<"prvi"<<endl;
   }
    else if(x == a and y < b){
        cout<<"drugi"<<endl;
    }
    else if(x < a and y < b){
        cout<<"?"<<endl;
    }
    
    
    
    return 0;
}