#include <iostream>
using namespace std;
int main()
{
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    (x ==a ||  b ==y) ? (a == x) ? (b == y) ? cout << "nijedan" : cout << "drugi" : cout << "prvi" : cout << "?";

}