#include <bits/stdc++.h>

using namespace std;

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