#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
   	int a, b, x, y;
   	cin >> a >> b >> x >> y;
   	if(a == x && b == y) {
   		cout << "nijedan";
   		return 0;
   	}
   	if(x < a && y < b) {
   		cout << "?";
   		return 0;
   	}
   	if(x == a) {
   		cout << "drugi";
   		return 0;
   	}
	cout << "prvi";
    return 0;
}