#include <iostream>

using namespace std;

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