#include<bits/stdc++.h>

using namespace std;

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