using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var nhm = ReadInts();
            var mkg = ReadInts();

            var time = new List<string>();

            for (int i = 1; i < nhm.Length; i += 2)
            {
                if (nhm[i + 1] < 10)
                {
                    time.Add(nhm[i] + ":0" + nhm[i + 1]);
                }
                else
                {

                    time.Add(nhm[i] + ":" + nhm[i + 1]);
                }
            }
            for (int i = 1; i < mkg.Length; i += 2)
            {
                if (mkg[i + 1] < 10)
                {

                    time.Add(mkg[i] + ":0" + mkg[i + 1]);
                }
                else
                {

                    time.Add(mkg[i] + ":" + mkg[i + 1]);
                }
            }

            System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US");

            time.Sort();

            for (int i = 0; i < time.Count - 1; i++)
            {
                if (time[i] == time[i + 1])
                {
                    time.RemoveAt(i + 1);
                }
            }

            var timelist = new List<DateTime>();
            foreach (var item in time)
            {
                DateTime a = DateTime.Parse(item);
                timelist.Add(a);
            }
            timelist.Sort();

            var x1 = timelist[0].ToString("HH");
            if (x1[0] == '0')
            {
                Write(x1[1]);
            }
            else
            {
                Write(timelist[0].ToString("HH"));
            }
            Write(":" + timelist[0].ToString("mm"));

            for (int i = 1; i < timelist.Count; i++)
            {
                var x = timelist[i].ToString("HH");
                if (x[0] == '0')
                {
                    Write(" " + x[1]);
                }
                else
                {
                    Write(" " + timelist[i].ToString("HH"));
                }

                Write(":" + timelist[i].ToString("mm"));

            }
            WriteLine();
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        //最大公約数

        public static int Gcd(int a, int b)
        {
            if (a < b)
            {
                return Gcd(b, a);
            }
            while (b != 0)
            {
                var reminder = a % b;
                a = b;
                b = reminder;
            }
            return a;
        }

        //最小公倍数
        public static int Lcm(int a, int b)
        {
            return a * b / Gcd(a, b);
        }

        //文字数を数える
        public static int CountChar(string s, char c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }
    }
}



Measured memory_bytes: 21928