using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Runtime.ExceptionServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        
        static void Main(string[] args)
        {
            string[] a = Console.ReadLine().Split();
            int PZ1 = int.Parse(a[0]);
            int PZ2 = int.Parse(a[1]);
            string[] b = Console.ReadLine().Split();
            int R1 = int.Parse(b[0]);
            int R2 = int.Parse(b[1]);
            if (R1==PZ1 && R2<PZ2)
            {
                Console.WriteLine("drugi");
            }
            else if (R1==PZ1 && R2==PZ2)
            {
                Console.WriteLine("nijedan");
            }
            else if (R1<PZ1 && R2<PZ2)
            {
                Console.WriteLine("?");
            }
            else
            {
                Console.WriteLine("prvi");
            }
        }
    }
}