def getInterval time
  day = Time.local(2014, 12, 8, time[3], time[4], time[5]) - Time.local(2014, 12, 8, time[0], time[1], time[2])
  day = day.divmod(24*60*60)
  hour = day[1].divmod(60*60)
  min = hour[1].divmod(60)
  sec = min[1]
  [hour[0], min[0], sec.to_i]
end

3.times do
  puts getInterval($stdin.gets.chomp.split(" ").map(&:to_i)).join(" ")
end