#include <bits/stdc++.h>
#define ll long long

using namespace std;


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

    int a, b, x, y;
    cin >> a >> b >> x >> y;

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

    return 0;
}