#include<bits/stdc++.h>
int main()
{
    int a, b, x, y;
    scanf("%d%d", &a, &b);
    scanf("%d%d", &x, &y);

    if(a == x && b == y) printf("nijedan");
    else if(a == x) printf("drugi");
    else if(b == y) printf("prvi");
    else printf("?");

    return 0;
}