#include <iostream>

using namespace std;

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