#include <bits/stdc++.h>
 
typedef long long ull; 

using namespace std;

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