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

long long a,b,x,y;

int main(){
  cin >> a >> b >> x >> y;
  if(y == b && x < a){
    cout << "prvi\n";
  }
  else if(a == x && y < b){
    cout << "drugi\n";
  }
  else if(a == x && b == y){
    cout << "nijedan\n";
  }
  else{
    cout << "?\n";
  }

  return 0;
}