#include <bits/stdc++.h>
#define ff(i, a, b) for(int(i)=a; (i)<b; (i)++)
#define fb(i, a, b) for(int(i)=a; (i)>b; (i)--)
#define vt vector
#define pb push_back
#define ll long long
#define ull unsigned long long
#define bn "\n"
#define sp " "

using namespace std;

void solve(){
    int a, b; cin >> a >> b;
    int x, y; cin >> x >> y;

    if(x==a && y==b){cout << "nijedan" << bn;}
    else if(x==a && y<b){cout << "drugi" << bn;}
    else if(x<a && y==b){cout << "prvi" << bn;}
    else if(x<a && y<b){cout << "?" << bn;}
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cerr.tie(0);
    solve();
    return 0;
}