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

int main() {
    int k_a, k_b; // konacni rezultat
    int t_a, t_b; // trenutni rezultat
    cin >> k_a >> k_b;
    cin >> t_a >> t_b;
    if(t_a == k_a && t_b == k_b) {
        cout << "nijedan" << endl;
    }
    else if(t_a == k_a && t_b < k_b) {
        cout << "drugi" << endl;
    }
    else if(t_a < k_a && t_b == k_b) {
        cout << "prvi" << endl;
    }
    else {
        cout << "?" << endl;
    }
    return 0;
}