#include <iostream>

using namespace std;

int main()
{
    int a, b, c, d; cin >> a >> b >> c >> d;
    if(a == c and b == d) cout << "nijedan" << endl;
    if(a>c and b>d) cout << "?";
    if(a==c and b>d) cout << "drugi";
    if(a>c and b==d) cout << "prvi";

    return 0;
}