#include <bits/stdc++.h>
using namespace std;
int a,b,c,d;
int main(){
  cin >> a >> b >> c >> d;
  if(c<a and d>=b){
    cout << "prvi\n";
  }
  else if(c>=a and d<b){
    cout << "drugi\n";
  }
  else if(c>=a and d>=b){
    cout << "nijedan\n";
  }
  else cout << "?\n";
}