#include <iostream>

using namespace std;

int main()
{
    int a, b, x, y;
    cin >> a >> b;
    cin >> x >> y;
    int p = a - x, q = b - y;
    if (p == 0 && q == 0) cout << "nijedan";
    else if (p == 0 && q > 0) cout << "drugi";
    else if (p > 0 && q == 0) cout << "prvi";
    else cout << "?";
	return 0;
}