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