#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a, b, x, y, c, d;
    cin >> a >> b >> x >> y;
    c = a - x;
    d = b - y;
    if (c == 0 && d == 0) cout << "nijedan";
    else if (d == 0) cout << "prvi";
    else if (c == 0) cout << "drugi";
    else cout << "?";
    return 0;
}