#include <bits/stdc++.h>
using namespace std;
int a, b, x, y;
int main(){
    cin>>a>>b;
    cin>>x>>y;
    
    if(a > x && b == y) cout<<"prvi";
    if(a == x && b > y) cout<<"drugi";

    if(a == x && b == y) cout<<"nijedan";
    if(a > x && b > y) cout<<"?";

    


    return 0;
}