#include<bits/stdc++.h>
#define ll long long
#define MAXN 200007
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int a,b,x,y;
    cin>>a>>b;
    cin>>x>>y;
    if(a>x && b>y) cout<<"?"<<endl;
    else if(a>x) cout<<"prvi"<<endl;
    else if(b>y) cout<<"drugi"<<endl;
    else cout<<"nijedan"<<endl;
}