#!/usr/bin/ruby
# -*- coding: utf-8 -*-

3.times do
  tcard = gets.split.map(&:to_i)
  intime = (tcard[0] * 60 + tcard[1]) * 60 + tcard[2]
  res = (tcard[3] * 60 + tcard[4]) * 60 + tcard[5] - intime
 
  h = res / 3600
  res %= 3600
  m = res / 60
  s = res % 60
  puts "#{h} #{m} #{s}"
end