#include<bits/stdc++.h>

using namespace std;

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

    unsigned long long x, y, a, b;
    string ans = "";

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

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

    cout << ans;
    return 0;
}