#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int a, b; cin >> a >> b;
    int x, y; cin >> x >> y;
    if (x == a && y == b) {
        cout << "nijedan\n";
    } else if (x < a && y < b) {
        cout << "?\n";
    } else if (x == a) {
        cout << "drugi\n";
    } else
        cout << "prvi\n";
}