#include <iostream>
using namespace std;
int main()
{
    long long a,b,c,d;
    cin >> a  >> b >> c >> d;
    if(a==c && b==d){cout << "nijedan";}
    if(a!=c && b!=d){cout<<"?";}
    if(a!=c && b==d){cout <<"prvi";}
    if(a==c && b!=d){cout <<"drugi";}
}