#include<iostream>
using namespace std;
main()
{
    int x,y,a,b;
    cin>>a>>b>>x>>y;
    if(a==x&&b==y)cout<<"nijedan";
    else if(a==x)cout<<"drugi";
    else if(b==y)cout<<"prvi";
    else cout<<"?";
    return 0;
}