#include <bits/stdc++.h>
using namespace std;
int a, b, x, y;
int main () {
    cin >> x >> y;
    cin >> a >> b;
    if (a==x and y>b){
        cout << "drugi" <<endl;
    }
    if (a==x and b==y){
        cout << "nijedan" << endl;
    }
    if (x>a and y==b){
        cout << "prvi" << endl;
    }
    if (x>a and y>b){
        cout << "?" << endl;
    }

}