#include <iostream>

using namespace std;

int main(void){

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

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


    return 0;
}