#include <bits/stdc++.h>
using namespace std;

int main(){
      unsigned long long a, b, x, y;
            scanf("%llu %llu", &a, &b);
                  scanf("%llu %llu", &x, &y);

                        if(a == x && b == y)
                                    printf("nijedan\n");
                                          else if(a == x)
                                                      printf("drugi\n");
                                                            else if(b == y)
                                                                        printf("prvi\n");
                                                                              else
                                                                                          printf("?\n");

                                                                                                return 0;
                                                                                                }