#include <bits/stdc++.h>
using namespace std;
int a,b,x,y;

int main () {
    cin>>a>>b>>x>>y;
    if (a-x!=0 and b-y==0) cout<<"prvi"<<endl;
    else if (a-x==0 and b-y!=0) cout<<"drugi"<<endl;
    else if (a-x==0 and b-y==0) cout<<"nijedan"<<endl;
    else if (a-x!=0 and b-y!=0) cout<<"?"<<endl;



return 0;
}