#include <iostream>

using namespace std;

int main()
{
    int x1,x2,x3,x4;
    cin>>x1>>x2>>x3>>x4;
    if(x1==x3 && x2==x4)
        cout<<"nijedan";
    if(x1>x3 && x2==x4)
        cout<<"prvi";
    if(x1==x3 && x2>x4)
        cout<<"drugi";
    if(x1>x3 && x2>x4)
        cout<<"?";
    return 0;
}