#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double dbl;
typedef vector <int> vi;
typedef vector <long long> vll;
typedef vector <string> vs;
const int inf = 1e9 + 5;
#define FAST ios::sync_with_stdio(false); cin.tie(0);
#define MAX INT_MAX
#define MIN INT_MIN
#define potato 0
#define lomljenje break

/*
#define A first
#define B second
#define PB push_back
#define MP make_pair
*/

int main()
{
    FAST

    int a, b;
    int x, y;
    cin >> a >> b;
    cin >> x >> y;
    bool prvi = false, drugi = false;
    if(a == x && b == y)
    {
        cout << "nijedan";
        return potato;
    }
    if(a > x) prvi = true;
    if(b > y) drugi = true;

    if(prvi && drugi) cout << "?";
    else if(prvi) cout << "prvi";
    else cout << "drugi";
    return potato;
}