#include <bits/stdc++.h>
#define MAXN 300010
#define pb push_back
#define ll long long
#define fi first
#define se second
#define mp make_pair
#define pii pair<int, int>

using namespace std;

void solve()
{
    int a, b;
    cin >> a >> b;
    int x, y;
    cin >> x >> y;
    if (x == a && y < b)
        cout << "drugi\n";
    else if (y == b && x < a)
        cout << "prvi\n";
    else if (x == a && y == b)
        cout << "nijedan\n";
    else
        cout << "?\n";
}

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

	int tt = 1;
	//cin >> tt;
	while(tt--)
	{
		solve();
	}
	return 0;
}