#include <iostream>

using namespace std;

int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if(a != c && b != d)
        cout << "?";
    else if (a == c && b == d)
        cout << "nijedan";
    else if(a != c && b == d)
        cout << "prvi";
    else
        cout << "drugi";
    return 0;
}