#include<bits/stdc++.h>

using namespace std;


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


    return 0;
}