require 'date'
def calcTime(x)
    x1=DateTime.new(2020,1,1,x[0],x[1],x[2])
    x2=DateTime.new(2020,1,1,x[3],x[4],x[5])
    diff = (x2.to_time-x1.to_time).to_i
    hour = diff / (60*60)
    minute = (diff-hour*60*60)/60
    second = (diff-hour*60*60-minute*60)
    puts "#{hour} #{minute} #{second}"
end
calcTime(gets.split.map(&:to_i))
calcTime(gets.split.map(&:to_i))
calcTime(gets.split.map(&:to_i))
