#include <iostream>
#include <cmath>
#include <cstdlib>
#include <iomanip>

using namespace std;

int main()
{
    long long int a,b,x,y;
    scanf("%lld%lld",&a,&b);
    scanf("%lld%lld",&x,&y);
    if (x == a && y != b) printf("drugi");
    else if (x != a && y == b) printf("prvi");
    else if (x == a && y == b) printf("nijedan");
    else printf("?");
    return 0;
}