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