using System;

namespace _11
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            int x, y;

            
            String[] tmp = Console.ReadLine().Split(' ');
            a = Convert.ToInt32( tmp[0]);
            b = Convert.ToInt32(tmp[1]);

            tmp = Console.ReadLine().Split(' ');
            x = Convert.ToInt32(tmp[0]);
            y = Convert.ToInt32(tmp[1]);



            bool jedan = a - x > 0;
            bool dva = b - y > 0;

            if (jedan)
            {
                if(dva)
                {
                    Console.WriteLine("?");
                }
                else
                {
                    Console.WriteLine("prvi");
                }
            }
            else
            {
                if (dva)
                {
                    Console.WriteLine("drugi");
                }
                else
                {
                    Console.WriteLine("nijedan");
                }
            }
        }
    }
}