#include <iostream>

int main()
{
    int a, b, x, y;
    std::cin >> a >> b >> x >> y;
    if(a == x and b == y){

        std::cout << "nijedan";

    }else if(a == x and b != y){

        std::cout << "drugi";

    }else if(a != x and b == y){

        std::cout << "prvi";

    }else if(a != x and b != y){

        std::cout << "?";

    }
    return 0;
}