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

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] unos = Console.ReadLine().Split();
            int a = Convert.ToInt32(unos[0]);
            int b = Convert.ToInt32(unos[1]);
            unos = Console.ReadLine().Split();
            int x = Convert.ToInt32(unos[0]);
            int y = Convert.ToInt32(unos[1]);

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