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

namespace ConsoleApp46
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] niz = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(niz[0]);
            int b = Convert.ToInt32(niz[1]);
            niz = Console.ReadLine().Split(' ');
            int x = Convert.ToInt32(niz[0]);
            int y = Convert.ToInt32(niz[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");
            }
            
        }
    }
}