import Control.Monad

main :: IO ()
main = do
  ls <- replicateM 3 getLine
  let ls' = map (map read . words) ls
  mapM_ putStrLn $ map solve ls'

solve :: [Int] -> String
solve [h1,m1,s1,h2,m2,s2] = toTime (h2*3600 - h1*3600 + m2*60 - m1*60 + s2 -s1)
  where
    toTime :: Int -> String
    toTime i = (show hour) ++ " " ++ (show minu) ++ " " ++ (show sec)
      where
        hour = i `div` 3600
        minu = (i - 3600 * hour) `div` 60
        sec = i `mod` 60