#include<bits/stdc++.h>

using namespace std;

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

    int a,b,x,y;

    cin >> a;
    cin >> b;
    cin >> x;
    cin >> y;

    if(a==x && b==y)
    {
        cout << "nijedan" << endl;
    }
    else if(a>x && b==y)
    {
        cout << "prvi" << endl;
    }
    else if(a==x && b>y)
    {
        cout << "drugi" << endl;
    }
    else if(a>x && b>x)
    {
        cout << "?" << endl;
    }
    
    return 0;
}