#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll x, y, a, b;

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