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

namespace ConsoleApp18
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] pred = Console.ReadLine().Split(' ');
            string[] dred = Console.ReadLine().Split(' ');
            int a = int.Parse(pred[0]);
            int b = int.Parse(pred[1]);
            int x = int.Parse(dred[0]);
            int y = int.Parse(dred[1]);
            string rez = "";
            if (a == x && b == y) rez = "nijedan";
            if (a > x && b == y) rez = "prvi";
            if (a == x && b > y) rez = "drugi";
            if (a > x && b > y) rez = "?";
            Console.WriteLine(rez);
            Console.Read();
        }
    }
}