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

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