#include <bits/stdc++.h>
using namespace std;
int a,b,x,y;
int main(){
    cin>>a>>b>>x>>y;
    if(a>x and y==b)
        cout<<"prvi"<<'\n';
    else if(a==x and b>y)
        cout<<"drugi"<<'\n';
    else if(a==x and b==y)
        cout<<"nijedan"<<'\n';
    else
        cout<<"?"<<'\n';
return 0;
}