#include <stdio.h>
int main() {
  int a, b, x, y;
  scanf("%d%d", &a, &b);
  scanf("%d%d", &x, &y);
  if (a == x && b == y)
    printf("nijedan\n");
  else if (a != x && b == y)
    printf("prvi\n");
  else if (a == x && b != y)
    printf("drugi\n");
  else
    printf("?\n");
}