#include <iostream>

using namespace std;

int main()
{

  long long a, b;
  long long x, y;

  cin >> a >> b;

  cin >> x >> y;


  if (a == x && b == y) {
    cout << "nijedan\n";
    return 0;
  }

  if (a > x && b > y) {
    cout << "?\n";
    return 0;
  }

  if (a > x)
    cout << "prvi\n";
  else
    cout << "drugi\n";

  return 0;
}