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

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    short a, b, x, y;
    cin >> x >> y >> a >> b;
    if (a==x && b==y)
        cout << "nijedan";
    if (a<x && b<y)
        cout << "?";
    if (a<x && b==y)
        cout << "prvi";
    if (a==x && b<y)
        cout << "drugi";
    return 0;
}