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

namespace _27_9
{
    class Program
    {

        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] s1 = s.Split(' ');
            long a = long.Parse(s1[0]);
            long b = long.Parse(s1[1]);
            s = Console.ReadLine();
            s1 = s.Split(' ');
            long x = long.Parse(s1[0]);
            long y = long.Parse(s1[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("prvi");
                    else
                        Console.WriteLine("drugi");
                }
            }
        }
    }
}