answer = []
3.times do
  time = gets.split.map(&:to_i)
  t1 = Time.new(2015, 9, 16, time[0], time[1], time[2])
  t2 = Time.new(2015, 9, 16, time[3], time[4], time[5])
  hours = (t2 - t1).divmod(3600)
  minutes = hours[1].divmod(60)
  seconds = minutes[1]
  answer << [hours[0], minutes[0], seconds.to_i].join(" ")
end
puts answer