#include <bits/stdc++.h>
using namespace std;

int main(int argc, char **argv){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a == c && b == d) {
        cout << "nijedan" << endl;
    }
    else if (b == d && c < a) {
        cout << "prvi" << endl;
    }
    else if (a == c && d < b) {
        cout << "drugi" << endl;
    }
    else {
        cout << "?" << endl;
    }
    return 0;
}