#include <iostream>
int main() {
    std::ios_base::sync_with_stdio(false);
    short int  a, b, x, y;
    std::cin >> a >> b >> x >> y;
    if(a > x) {
        if(b == y)
            std::cout << "prvi";
        else
            std::cout << "?";
    }
    else if(b > y)
        std::cout << "drugi";
    else
        std::cout << "nijedan";
}