a,b=3600,60

for i in [1]*3:

	h,m,s,x,y,z=list(map(int,input().split()))

	s=(x-h)*a+(y-m)*b+(z-s)

	print(s//a,s%a//b,s%b)
b=60

a=b*b

for i in [1]*3:

	h,m,s,x,y,z=list(map(int,input().split()))

	s=(x-h)*a+(y-m)*b+z-s

	print(s//a,s%a//b,s%b)
a, b = 3600, 60
for i in [1] * 3:
    h, m, s, x, y, z = list(map(int, input().split()))
    s = (x - h) * a + (y - m) * b + (z - s)
    print(s // a, s % a // b, s % b)

b = 60
a = b * b
for i in [1] * 3:
    h, m, s, x, y, z = list(map(int, input().split()))
    s = (x - h) * a + (y - m) * b + z - s
    print(s // a, s % a // b, s % b)

-a, b = 3600, 60 +b = 60 +a = b * b -    s = (x - h) * a + (y - m) * b + (z - s) +    s = (x - h) * a + (y - m) * b + z - s