# -- coding: utf-8 --

# "Hello World!" display

for num in 1..3 do
	b = gets
	a = b.split()
	time = (a[3].to_i - a[0].to_i) * 3600
	time += (a[4].to_i - a[1].to_i) * 60
	time += (a[5].to_i - a[2].to_i)
	h_per = time/3600
	time -= h_per*3600
	m_per = time/60
	time -= m_per*60
	print(h_per.to_s + ' ' + m_per.to_s + ' ' + time.to_s + "\n")
end