#include <bits/stdc++.h>
#define en '\n'

using namespace std;

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