//  ? ? ? ? ? ? ?
//  ? @roadfromroi ?
//  ? ? ? ? ? ? ?
#include <iostream>
#include "vector"
#include "algorithm"
#include "numeric"
#include "climits"
#include "iomanip"
#include "bitset"
#include "cmath"
#include "map"
#include "deque"
#include "array"
#include "set"
#define all(x) x.begin(), x.end()
using namespace std;
void solve() {
    int a, b, x, y;
    cin >> a >> b >> x >> y;
    if (a == x and b == y) {
        cout << "nijedan\n";
        return;
    }
    if (a > x and b > y) {
        cout << "?\n";
        return;
    }
    if (a > x) {
        cout << "prvi\n";
    } else {
        cout << "drugi\n";
    }
}
signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t = 1;
    while (t--) {
        solve();
    }
}