#include <iostream>
using namespace std;

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