#include <iostream>

using namespace std;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if(a - c == 0 && b - d == 0)
        cout << "nijedan";
    else if(a - c > 0 && b - d == 0)
        cout << "prvi";
    else if(a - c == 0 && b - d > 0)
        cout << "drugi";
    else
        cout << "?";
}