#include <iostream>

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

        std::cout << "nijedan";

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

        std::cout << "drugi";

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

        std::cout << "prvi";

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

        std::cout << "?";

    }
    return 0;
}