#include <bits/stdc++.h>
using namespace std;
using namespace std;
typedef long long ll;
typedef vector <int> vi;
typedef pair <int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
#define A first
#define B second
#define PB push_back
#define MP make_pair
#define PF push_front
#define all(v) v.begin(),v.end()
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);


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