#include <iostream>

int main() {
  int a, b, x, y;

  std::cin >> a >> b >> x >> y;

  if (x < a && y < b) {
    std::cout << "?" << std::endl;
  } else if (x < a) {
    std::cout << "prvi" << std::endl;
  } else if (y < b) {
    std::cout << "drugi" << std::endl;
  } else {
    std::cout << "nijedan" << std::endl;
  }

  return 0;
}