#include <iostream>

using namespace std;

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

    return 0;
}