#include <iostream>
#define forn(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    if (y == b && x < a) cout << "prvi";
    else if (x == a && y < b) cout << "drugi";
    else if (x == a && y == b) cout << "nijedan";
    else cout << "?";
    cout << endl;
}