#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int A, B, X, Y;
    cin >> A >> B >> X >> Y;
    if(A == X)
    {
        if(B == Y) {cout << "nijedan" << endl; return 0;}
        else
        {
            if(B > Y) {cout << "drugi" << endl; return 0;}
            else {cout << "prvi" << endl; return 0;}
        }
    }
    if(B == Y)
    {
        if(A > X) {cout << "drugi" << endl; return 0;}
        else {cout << "prvi" << endl; return 0;}
    }
    else {cout << "?" << endl; return 0;}
    return 0;
}