#include <bits/stdc++.h>


using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

    ll a, b, x, y;
    cin >> a >> b >> x >> y;
    if(a==x && b==y){
        cout<<"nijedan\n";
        return 0;
    }
    if(a==x){
        cout<<"drugi\n";
        return 0;
    }
    else{
        if(b==y){
            cout<<"prvi\n";
            return 0;
        }
        else
            cout<<"?\n";

    }



    return 0;
}