#include <iostream>
using namespace std;

int a, b, x, y;

int main(void) {

    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> a >> b >> x >> y;

    if(a == x && y == b) {
        cout << "nijedan\n";
    } else if( a == x ) {
        cout << "drugi\n";
    } else if( b == y ) {
        cout << "prvi\n";
    } else {
        cout << "?\n";
    }

    return 0;
}