#include <bits/stdc++.h>
using namespace std;   
typedef unsigned long long ull;


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