#include <iostream>

using namespace std;

int main() {

  int a, b;
  cin >> a >> b;

  int x, y;
  cin >> x >> y;

  if (x < a && y == b) {

    cout << "prvi" << endl;

  } else if (y < b && x == a) {

    cout << "drugi" << endl;

  } else if (x == a && y == b) {

    cout << "nijedan" << endl;

  } else {

    cout << "?" << endl;

  }

  return 0;
}