#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define li long long int
using namespace std;
int a,b,x,y;
int main(){
    cin >> a >> b >> x >> y;
    if (a==x and b==y) cout << "nijedan\n";
    else if (x<a and y<b) cout << "?\n";
    else if (a==x and b!=y) cout << "drugi\n";
    else cout << "prvi\n";
    return 0;
}