/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <iostream>

using namespace std;

int main()
{
    int a,b,x,y;
    cin>>a>>b>>x>>y;
    if(a==x && b==y)
    {
        cout<<"nijedan";
    }
    if(a!=x && b!=y)
    {
        cout<<"?";
    }
    if(a==x && b!=y)
    {
        cout<<"drugi";
    }
    if(a!=x && b==y)
    {
        cout<<"prvi";
    }

    return 0;
}