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

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