#include <bits/stdc++.h>

using namespace std;

int main()
{

    ios::sync_with_stdio(false);
    int x,y,a,b;
    cin >> a >> b >> x >> y;
    if(a-x==0 && b-y==0)
        cout << "nijedan";
    if(a-x==0 && b-y!=0)
        cout << "drugi";
    if(a-x!=0 && b-y==0)
        cout << "prvi";
    if(a-x!=0 && b-y!=0)
        cout << "?";

    return 0;
}