using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;
namespace ConsoleApp6
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] s1 = s.Split(' ');
            int a = int.Parse(s1[0]);
            int b = int.Parse(s1[1]);
            string s2 = Console.ReadLine();
            string[] s3 = s2.Split(' ');
            int x = int.Parse(s3[0]);
            int y = int.Parse(s3[1]);
            if (a == x && b == y)
            {
                Console.WriteLine("nijedan");
            }
                
            if (a > x && b > y)
            {
                Console.WriteLine("?");
            }
                
            if (a == x && b > y)
            {
                Console.WriteLine("drugi");
            }
                
            if (a > x && b == y)
            {
                Console.WriteLine("prvi");
            }
            


        }
    }
}