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

using ll = long long;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int a, b, x, y;
    cin >> a >> b >> x >> y;

    a -= x;
    b -= y;

    if (a == 0 && b == 0) {
        cout << "nijedan\n";
    }
    else if (a == 0) {
        cout << "drugi\n";
    }
    else if (b == 0) {
        cout << "prvi\n";
    }
    else cout << "?\n";

    return 0;
}