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

int main()
{
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int a,b,x,y;
    cin >> a >> b >> x >> y;
    if (a==x && b==y)
    {
        cout << "nijedan\n";
        return 0;
    }
    if (a==x)
    {
        cout << "drugi\n";
        return 0;
    }
    if (b==y)
    {
        cout << "prvi\n";
        return 0;
    }
    cout << "?\n";
    return 0;
}