#include<stdio.h>

int main() {
    int a,b,x,y;
    scanf("%d%d%d%d",&a,&b,&x,&y);
    a=a-x;
    b=b-y;
    if(a>0 && b>0){printf("?");}
    else if(a>0){printf("prvi");}
    else if(b>0){printf("drugi");}
    else {printf("nijedan");}
    return 0;
}