#include <iostream>

int main() {
    int a,b,x,y = 0;
    std::cin>>a>>b>>x>>y;
    
    if(x == a && y == b){
        std::cout << "nijedan";
    }else if(x < a && y == b){
        std::cout << "prvi";
    }else if(x == a && y < b){
        std::cout << "drugi";
    }else if(x < a && y < b){
        std::cout << "?";
    }
    
    return 0;
}