#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

int main() {
    ull a1, a2, b1, b2;
    cin >> a1 >> b1 >> a2 >> b2;
    if(a1 == a2 && b1 == b2) {
        cout << "nijedan\n";
        return 0;
    }
    if(a1 == a2) {
        cout << "drugi\n";
        return 0;
    }
    if(b1 == b2) {
        cout << "prvi\n";
        return 0;
    }
    cout << "?\n";
    return 0;
}