#include <iostream>

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

    if (a > x) {
        if (b == y) {
            std::cout << "prvi" << std::endl;
        } else if (b > y) {
            std::cout << "?" << std::endl;
        }
    } else if (a == x) {
        if (b == y) {
            std::cout << "nijedan" << std::endl;
        } else if (b > y) {
            std::cout << "drugi" << std::endl;
        }
    }

    return 0;
}