#include <bits/stdc++.h>
#define ull unsigned long long

using namespace std;

int main() {


    int a,b;
    int x,y;
    scanf("%d%d",&a,&b);
    scanf("%d%d",&x,&y);
    if (a-x > 0 && b-y > 0) {
        printf("?");
        return 0;
    }
    if (a-x > 0 && b-y == 0) {
        printf("prvi");
        return 0;
    }
    if (a-x == 0 && b-y > 0) {
        printf("drugi");
        return 0;
    }
    if (a==x && b==y) {
        printf("nijedan");
        return 0;
    }
}