namespace program
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string unos;
            int a, b, x, y;
            Console.WriteLine("Unesi a i b");
            unos = Console.ReadLine();
            a = Convert.ToInt32(unos.Substring(0, unos.IndexOf(" ")));
            unos = unos.Substring(unos.IndexOf(" "));
            b = Convert.ToInt32(unos);
            Console.WriteLine("Unesi x i y");
            unos = Console.ReadLine();
            x = Convert.ToInt32(unos.Substring(0, unos.IndexOf(" ")));
            unos = unos.Substring(0, unos.IndexOf(" "));
            y = Convert.ToInt32(unos);

            if (x < a && y < b)
            {
                Console.WriteLine("?");
            }
            else if (x < a)
            {
                Console.WriteLine("prvi");
            }
            else if (y < b)
            {
                Console.WriteLine("drugi");
            }
            else if (a == x && b == y)
            {
                Console.WriteLine("nijedan");
            }
        }
    }
}