#include <iostream>
using namespace std;

void finale(int x, int y, int a, int b) {
    if(x == a && y == b) {
        cout << "nijedan";
    }
    else if (x == a && y != b) {
        cout << "drugi";
    }
    else if (x != a && y == b) {
        cout << "prvi";
    }
    else {
        cout << "?";
    }
}

int main() {

    int a, b, x, y;

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

    finale(x, y, a, b);

     return 0;
}