#include<bits/stdc++.h>
using namespace std;
int a,b,x,y;
int main ()
{
    cin >> a >> b;
    cin >> x >> y;

    if(a==x and b==y)
    {
        cout << "nijedan" << endl;
        return 0;
    }

    if(a==x and b!=y)
    {
        cout << "drugi" << endl;
        return 0;
    }

    if(a!=x and b==y)
    {
        cout << "prvi" << endl;
        return 0;
    }
    cout << '?' << endl;
    return 0;
}