#include <iostream>
#include <string>

void OptimizeIO() {
    std::ios_base::sync_with_stdio(false);
    std::cerr.tie(0);
    std::cout.tie(0);
    std::cin.tie(0);
}

std::string ShowExpectation(bool left, bool right) {
    if (left && right) return "nijedan";
    if (left && !right) return "drugi";
    if (!left && right) return "prvi";
    return "?";
}

int main() {
    using namespace std;
    OptimizeIO();
    int a;
    int b;
    cin >> a >> b;
    int x;
    int y;
    cin >> x >> y;
    cout << ShowExpectation(x == a, y == b) << endl;
    return 0;
}