#include <iostream>

using namespace std;

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