#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main(int argc, char *argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int a,b,x,y;
    cin>>a>>b>>x>>y;
    if(a==x){
        if(b==y)cout<<"nijedan";
        else cout<<"drugi";
    }
    else if(b==y){
        cout<<"prvi";
    }
    else cout<<"?";
}