//计算时、分、秒相加减,时为上可以是负数。
using System;
class student
{
public int shi;
public int fen;
public int miao;
public student(int shi, int fen, int miao)
{
this.shi = shi;
this.fen = fen;
this.miao = miao;
}
public static student operator +(student a, student b)
{
student c = new student(0, 0, 0);
c.miao= a.miao + b.miao;
if( c.miao >= 60)
{
c.fen += c.miao / 60;
c.miao %= 60;
}
c.fen = a.fen + b.miao;
if(c.fen >= 60)
{
c.shi += c.fen / 60;
c.fen %= 60;
}
c.shi = a.shi + b.shi;
return c;
}
public static student operator -(student a, student b)
{
student c = new student(0, 0, 0);
c.miao = a.miao - b.miao;
if(c.miao < 0)
{
c.fen -= (-c.miao) / 60;
c.miao = (-c.miao) % 60;
}
c.fen = a.fen - b.fen;
if(c.fen < 0)
{
c.shi -= (-c.fen) / 60;
c.fen = (-c.fen) % 60;
}
c.shi = a.shi - b.shi;
return c;
}
}
class class1
{
static void Main(string[] args)
{
int shi;
int fen;
int miao;
shi = int.Parse(Console.ReadLine());
fen = int.Parse(Console.ReadLine());
miao = int.Parse(Console.ReadLine());
student a1 = new student(shi, fen, miao);
shi = int.Parse(Console.ReadLine());
fen = int.Parse(Console.ReadLine());
miao = int.Parse(Console.ReadLine());
student a2 = new student(shi, fen, miao);
student c = a1 + a2;
Console.WriteLine("{0}:{1}:{2}", c.shi, c.fen, c.miao);
c = a1 - a2;
Console.WriteLine("{0}:{1}:{2}", c.shi, c.fen, c.miao);
}