#include <bits/stdc++.h>

using namespace std;

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

    long long a, b, a1, b1;
    cin >> a1 >> b1;
    cin >> a >> b;
    if(a < a1)
    {
        if(b == b1) cout << "prvi";
        else if(b < b1) cout << "?";
    }
    else if(a == a1)
    {
        if(b == b1) cout << "nijedan";
        else if(b < b1) cout << "drugi";
    }
}