/**
 *    author:  wxhtzdy
 *    created: 18.12.2022 10:11:24
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);  
  int a, b;
  cin >> a >> b;
  int x, y;
  cin >> x >> y;
  if (a == x && b == y) {
    cout << "nijedan" << '\n';
    return 0;
  }
  if (x < a && y < b) {
    cout << "?" << '\n';
    return 0;
  }
  if (x == a) {
    cout << "drugi" << '\n';
  } else {
    cout << "prvi" << '\n';
  }                                            
  return 0;
}