#include <iostream>
#include <cstdlib>

using namespace std;

int main() {

  int x, y, a, b;
  cin >> x >> y;
  cin >> a >> b;

  if (x == a && y == b) {
 
    cout << "nijedan" << endl;
  } else {

    if (x > y) {

      cout << "prvi" << endl;
    } else if (y > x) {

      cout << "drugi" << endl;
    } else {

      int team = rand() % 2;
      if (team == 0) {
        cout << "?" << endl;
      } else {
        cout << "?" << endl;
      }
    }
  }

  return 0;
}