#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int a,b,x,y;
    cin >> a >> b >> x >> y;
    if (x==a)
    {
        if (y==b)
            cout << "nijedan";
        else
            cout << "drugi";
    }
    else
    {
        if (y==b)
            cout << "prvi";
        else
            cout << "?";
    }
    return 0;
}