#include <iostream>

using namespace std;

int main()
{
    int a, b; cin >> a >> b;
    int x, y; cin >> x >> y;
    int raz1 = a-x, raz2 = b-y;
    if(raz1==0 && raz2>0) cout << "drugi"<<endl;
    else if(raz2==0 && raz1>0) cout << "prvi"<<endl;
    else if(raz1>0 && raz2>0) cout << "?"<<endl;
    else cout << "nijedan"<<endl;

    return 0;
}