#include <bits/stdc++.h>

using namespace std;

int a, b, x, y, r1, r2;

int main()
{
    cin >> x >> y >> a >> b;
    r1 = a - x;
    r2 = b - y;
    if (r1 && r2){
        cout << "?";
        return 0;
    }
    if (r1){
        cout << "prvi";
        return 0;
    }
    if (r2){
        cout << "drugi";
        return 0;
    }
    cout << "nijedan";
    return 0;
}