#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int a,b;
    cin >> a >> b;
    int x,y;
    cin >> x >> y;
    int p = a-x;
    int d = b-y;
    if(p==0 && d>0){
        cout << "drugi";
    }else if(p>0 && d==0){
        cout << "prvi";
    }else if(p==0 && d==0){
        cout << "nijedan";
    }else{
        cout << "?";
    }
    return 0;
}