#include <iostream>

using namespace std;

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

    return 0;
}