#include <iostream>

using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a, b, x, y;
    bool A, B;
    cin >> a >> b >> x >> y;
    A = x < a;
    B = y < b;
    if (A && B) cout << "?";
    else if (A) cout << "prvi";
    else if (B) cout << "drugi";
    else cout << "nijedan";
}