#include <iostream>
using namespace std;

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