#include <iostream>
using namespace std;

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

    int a, b, x, y;
    cin>>a>>b>>x>>y;
    switch (a==x)
    {
    case true:
        switch (b==y)
            {
            case true:
                cout<<"nijedan";
                break;
            
            case false:
                cout<<"drugi";
                break;
            }
        break;
    
    case false:
        switch (b==y)
            {
            case true:
                cout<<"prvi";
                break;
            
            case false:
                cout<<"?";
                break;
            }
        break;
    }

    return 0;
}