#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a,b,x,y;
    cin>>a>>b;
    cin>>x>>y;
    if(a==x&&b==y) cout<<"nijedan";
    else if(a==x&y<b) cout<<"drugi";
    else if(y==b&&x<a) cout<<"prvi";
    else cout<<"?";
    /*Ronaldo>>>>>>>>Messi   SIIIIIIIIIII  Franckuska dobija 3 0*/
}