#include <iostream>

using namespace std;

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