#include "bits/stdc++.h"
#define ll long long
using namespace std;

int main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);

  ll a, b, x, y;

  cin >> a >> b; //konacni rez
  cin >> x >> y; //trenutni rez

  if (abs(a-x) > 0 && abs(b-y) > 0)
    cout << "?" << endl;
  else if (abs(a-x) > 0)
    cout << "prvi";
  else if (abs(b-y) > 0)
    cout << "drugi";
  else
    cout << "nijedan";

  return 0;
}