#include <iostream>

using namespace std;

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

    return 0;
}