#include <iostream>

using namespace std;

int main(void){

    unsigned short int a, b;
    cin >> a >> b;
    
    unsigned short int x, y;
    cin >> x >> y;

    if((a == x) && (b == y))
        cout << "nijedan";
    else if((a > x) && (b == y))
        cout << "prvi";
    else if((a == x) && (b > y))
        cout << "drugi";
    else
        cout << "?";


    return 0;
}