#include <iostream>

using namespace std;

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