#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define mod 1000000007
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 && b==y)
        cout<<"nijedan\n";
    else if(a!=x && b!=y)
        cout<<"?\n";
    else if(a==x)
        cout<<"drugi\n";
    else
        cout<<"prvi\n";

    return 0;
}