#include <iostream>

using namespace std;

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