#include<bits/stdc++.h>

using namespace std;

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int a = 0, b = 0, x = 0, y = 0;

    cin >> a >> b;

    cin >> x >> y;

    if(a > x && b > y) cout << "?";

    if(a == x && b == y) cout << "nijedan";

    if(a > x && b == y) cout << "prvi";

    if(a == x && b > y) cout << "drugi";

}