#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a,b,x,y;
    cin>>a>>b;
    cin>>x>>y;
    if(a-x>0&&b-y>0){cout<<"?";return 0;}
    if(a==x&&b==y){cout<<"nijedan";return 0;}
    if(a==x&&b!=y){cout<<"drugi"; return 0;}
    cout<<"prvi";


    return 0;
}