#include <iostream>

using namespace std;
int main() {
  int a, b, x, y;
  cin >> a >> b >> x >> y;

  int remaining_goals_a = a - x;
  int remaining_goals_b = b - y;

  if (remaining_goals_a > 0 && remaining_goals_b > 0) {
    cout << "?" << endl;
  } else if (remaining_goals_a > 0) {
    cout << "drugi" << endl;
  } else if (remaining_goals_b > 0) {
    cout << "prvi" << endl;
  } else {
    cout << "nijedan" << endl;
  }

  return 0;
}