#include <iostream>

int main() {
  // Read the spoiled result and half-time score
  int a, b, x, y;
  std::cin >> a >> b >> x >> y;

  // Calculate the number of goals remaining for each team
  int remaining_goals_a = a - x;
  int remaining_goals_b = b - y;

  // Determine which team will score the next goal
  if (remaining_goals_a > 0 && remaining_goals_b > 0) {
    // Both teams can still score
    std::cout << "?" << std::endl;
  } else if (remaining_goals_a > 0) {
    // Only team A can still score
    std::cout << "drugi" << std::endl;
  } else if (remaining_goals_b > 0) {
    // Only team B can still score
    std::cout << "prvi" << std::endl;
  } else {
    // No more goals can be scored
    std::cout << "nijedan" << std::endl;
  }

  return 0;
}