#include<bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);cin.tie(0);
    int a, b, c, d, r1, r2;
    cin >> a >> b >> c >> d;
    r1 = a-c;
    r2 = b-d;
    if(r1 == 0 && r2 == 0) cout << "nijedan";
    else if(r1 == 0 && r2 > 0) cout << "drugi";
    else if(r2 == 0 && r1 > 0) cout << "prvi";
    else cout << "?";
}