#include<stdio.h>
#include<stdlib.h>

int main()
{
    int n1, n2, x1, x2;
    scanf("%d%d", &n1, &n2);
    scanf("%d%d", &x1, &x2);
    if((x1 == n1) && (x2 == n2))
    {
        printf("nijedan");
    }
    else{
        if((x1<n1)&&(x2==n2))   
            printf("prvi");
        else{
            if((x1==n1)&&(x2<n2))
                {
                    printf("drugi");
                }
            else
                {
                    printf("?");
                }
            }
        }      
}