#include <bits/stdc++.h>
#define ll long long


using namespace std;

void solve() {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    int aRaz = a-x;
    int bRaz = b-y;
    if (aRaz == 0 && bRaz == 0) {
        cout << "nijedan";
        return;
    }
    if (aRaz == 0) {
        cout << "drugi";
        return;
    }
    if (bRaz == 0) {
        cout << "prvi";
        return;
    }
    cout << "?";
}


int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    solve();
    return 0;
}