#include <iostream>

using namespace std;

int main()
{
    int x, y, a, b;
    cin >> a >> b >> x >> y;
    if(a == x && b == y){
        cout << "nijedan" << endl;
    }
    if(a == x && y < b){
        cout << "drugi" << endl;
    }
    if(a > x && y == b){
        cout << "prvi" << endl;
    }
     if(a > x && y < b){
        cout << "?" << endl;
    }
    return 0;
}