#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m, n1 , m1;
    cin >> n >> m >> n1 >> m1;
    bool T1 = n == n1;
    bool T2 = m == m1;
    if(T1 && T2)
    { 
        cout << "nijedan";
    }
    else if(T1)
    { 
        cout << "drugi";
    }
    else if(T2){ 
         cout << "prvi";
    }
    else 
    { 
        cout << "?";
    }
    return 0;
}