#include <iostream>

using namespace std;

void r(long long x, long long b, long long a, long long 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()
{   long long a,b,x,y;
    cin>>a>>b>>x>>y;
    r(x,b,a,y);

    return 0;
}