#include <bits/stdc++.h>

using namespace std;

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