#include <iostream>

using namespace std;

int main()
{
    int a, b;
    int x, y;
    cin >> a >> b >> x >> y;
    if (y==b && x!=a)
        cout << "prvi" << endl;
    if (x==a && y!=b)
        cout << "drugi" << endl;
    if (x==a && y==b)
        cout << "nijedan" << endl;
    if (x!=a && y!=b)
        cout << "?" << endl;

    return 0;
}