#include <iostream>
using namespace std;

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