#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int a,b,x,y;

    cin >> a >> b;
    cin >> x >> y;

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

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


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

    cout << "?" << endl;


    return 0;
}