#include <bits/stdc++.h>

using namespace std;

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