using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1

{

    class Program

    {  
        static void Main(string[] args)

        {
            string[] red1 = new string[1];
            string[] red2 = new string[1];
            red1 = Console.ReadLine().Split(" ");
            int a = int.Parse(red1[0]);
            int b = int.Parse(red1[1]);
            red2 = Console.ReadLine().Split(" ");
            int x = int.Parse(red2[0]);
            int y = int.Parse(red2[1]);
            if(a+b==x+y)
            {
                Console.WriteLine("nijedan");
            }
            else if(x==a && b!=y)
            {
                Console.WriteLine("drugi");
            }
            else if (x != a && b == y)
            {
                Console.WriteLine("prvi");
            }
            else
            {
                Console.WriteLine("?");
            }
        }
    }
}