#include <iostream>

using namespace std;

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

    return 0;
}