#include <iostream>
using namespace std;

int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    if (a == x) cout << (b == y ? "nijedan" : "drugi");
    else cout << (b == y ? "prvi" : "?");
}