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

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

            inputLine = Console.ReadLine().Split(' ');

            a = Convert.ToInt32(inputLine[0]);
            b = Convert.ToInt32(inputLine[1]);

            inputLine = Console.ReadLine().Split(' ');

            x = Convert.ToInt32(inputLine[0]);
            y = Convert.ToInt32(inputLine[1]);

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

        }
    }
}