#include <bits/stdc++.h>
#define pb push_back
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define ll long long
using namespace std;
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll a,b,x,y;cin>>a>>b>>x>>y;
    if(x<a && y<b)cout<<"?";
    else if(x<a && y==b)cout<<"prvi"<<endl;
    else if(x==a && y<b)cout<<"drugi"<<endl;
    else cout<<"nijedan";
	return 0;
}