#include <bits/stdc++.h>

using namespace std;

unsigned long long a, b, x, y;


int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> a >> b >> x >> y;

    if (x < a && y < b) cout << "?";
    else if (x == a && y == a) cout << "nijedan";
    else if (x < a && y == a) cout << "prvi";
    else cout << "drugi";


return 0;
}