#include<bits/stdc++.h>
using namespace std;

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