using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            byte x = Convert.ToByte(s[0]);
            byte y = Convert.ToByte(s[1]);
            string[] w = Console.ReadLine().Split();
            byte a = Convert.ToByte(w[0]);
            byte b = Convert.ToByte(w[1]);
            if (a < x && b < y)
            {
                Console.WriteLine("?");
            }
            else if (a <= x && b < y)
            {
                Console.WriteLine("drugi");
            }
            else if (a < x && b <= y)
            {
                Console.WriteLine("prvi");
            }
            else if (a <= x && b <= y)
            {
                Console.WriteLine("nijedan");
            }
            Console.ReadLine();
        }
    }
}