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