#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <math.h>
#include <set>

using namespace std;
typedef long long ll;
#define cy cout << "YES"<< endl;
#define cn cout << "NO"<< endl;
#define pf push_front
#define pb push_back
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vll vector<ll>


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(nullptr);
    
    int a,b,x,y;cin >> a >> b >> x >> y;
    if(x<a && y<b)
        cout << "?" << endl;
    else if(x==a && y < b)
        cout << "drugi" << endl;
    else if(x<a && y==b)
        cout << "prvi" << endl;
    else if(x==a && y==b)
        cout << "nijedan" << endl;

}