#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long x,y,a,b;
    cin >> a >> b >> x >> y;
    if(x==a  && y == b) cout << "nijedan";
    else if(a == x && b > y) cout << "drugi";
    else if(a > x && b == y) cout << "prvi";
    else cout << "?";
}