using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Pipes;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        
        static void Main(string[] args)
        {
            int a, b, x, y;
            string in1 = Console.ReadLine();
            string[] s = in1.Split(' ');
            a = int.Parse(s[0]);
            b = int.Parse(s[1]);
            string in2 = Console.ReadLine();
            string[] s2 = in2.Split(' ');
            x = int.Parse(s2[0]);
            y = int.Parse(s2[1]);
            if (a - x > 1 && b - y == 0)
            {
                Console.WriteLine("prvi");
            }
            else if (b - y > 1 && a - x == 0)
            {
                Console.WriteLine("drugi");
            }
            else if (a - x == 0 && b - y == 0)
            {
                Console.WriteLine("nijedan");
            }
            else
            {
                Console.WriteLine("?");
            }

        }   
    }
}