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

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