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

namespace ConsoleApp39
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string rezultat = Console.ReadLine();
            string[] ab = rezultat.Split();
            string poluvreme = Console.ReadLine();  
            string [] xy = poluvreme.Split();
            byte a = byte.Parse(ab[0]);
            byte b = byte.Parse(ab[1]);
            byte x = byte.Parse(xy[0]);
            byte y = byte.Parse(xy[1]);
            if (x == a && y == b) Console.WriteLine("nijedan");
            else if (x < a && y < b) Console.WriteLine('?');
            else if (x == a && y < b) Console.WriteLine("drugi");
            else Console.WriteLine("prvi");
        }
    }
}