#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a;
    int b;

    int x;
    int y;

    cin >> a;
    cin >> b;

    cin >> x;
    cin >> y;

    int d1 = a - x;
    int d2 = b - y;

    if(d1 == 0 && d2 == 0)
        cout << "nijedan" << '\n';
    else if(d1 == 0)
        cout << "drugi" << '\n';
    else if(d2 == 0)
        cout << "prvi" << '\n';
    else
        cout << "?" << '\n';

    return 0;
}