#include <bits/stdc++.h>
using namespace std;



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