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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string[] input = Console.ReadLine().Split(' ');
                int t = int.Parse(input[0]);
                int h = int.Parse(input[1]);
                int s = int.Parse(input[2]);

                if (t == -1) break;

                TimeSpan tape = new TimeSpan(2, 0, 0);
                TimeSpan n = new TimeSpan(t, h, s);

                int sec = (t * 60 * 60 + h * 60 + s) / 3;

                TimeSpan m = new TimeSpan(0, 0, sec);

                Console.WriteLine(tape - n);
                Console.WriteLine(tape - m);
            }
        }
    }
}