module Main where
main :: IO ()
main = do
 { line1 <- getline
 ; let [s,h,m,s] = map read (words line1) :: [Int]
 ; let hour   = divMod s 60
 ; let minute = divMod s 60 60
 ; let second = divMod s 60 60 60
 ; putStrLn (unwords (map show [hour, minute, second]))
 }