#include <iostream>

using namespace std;

int main()
{
    int a, b,x,y;
    cin >> a >> b;
    cin >> x >> y;
    if (a == x && b == y)
        printf("nijedan");
    else if (a==x && b > x) {
        printf("drugi");
    }
    else if(a>x && b==y)
    {
        printf("prvi");
    }
    else
    {
        printf("?");
    }
}