#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    string ans = "";
    if (a > x && b > y)
    ans = "?";
    else if (a > x)
    ans = "prvi";
    else if (b > y)
    ans = "drugi";
    else ans = "nijedan";
    cout << ans;
}