#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <time.h>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <iterator>
#include <windows.h>
#include <cmath>

#define INF 0x3f3f3f3f

using namespace std;
using std::cerr;
using std::cin;
using std::cout;
using std::endl;
using std::ifstream;
using std::istringstream;
using std::ostringstream;
using std::string;
using std::stringstream;
using std::vector;

class score
{
public:
    int host, guest;

    void input()
    {
        cin >> host;
        cin >> guest;
    }
};

string checkScores(score halfTimeScore, score fullTimeScore)
{
    bool willHostScore = fullTimeScore.host - halfTimeScore.host > 0;
    bool willGuestScore = fullTimeScore.guest - halfTimeScore.guest > 0;

    if (willHostScore && !willGuestScore)
        return "prvi";
    else if (!willHostScore && willGuestScore)
        return "drugi";
    else if (!willHostScore && !willGuestScore)
        return "nijedan";
    else if (willHostScore && willGuestScore)
        return "?";
}

int main()
{
    score halfTimeScore, fullTimeScore;

    fullTimeScore.input();
    halfTimeScore.input();

    cout << checkScores(halfTimeScore, fullTimeScore) << endl;

    return 0;
}