#include <iostream>

using namespace std;

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

    return 0;
}