#include <iostream>

using namespace std;

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