#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const double EPS = 1E-6;
const ll MOD = 1000000007;
const ll HIGH = 4611686018427387904; // 2^62

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    if (a == x && b == y) {
        cout << "nijedan" << '\n';
    }
    else if (a == x && b != y) {
        cout << "drugi" << '\n';
    }
    else if (a != x && b == y) {
        cout << "prvi" << '\n';
    }
    else {
        cout << "?" << '\n';
    }
}
/*
    Overflow?
    n = 1, n = 0, n = max
    array bound?
    a*b/c != a*(b/c) !!!
*/