joinBy :: String -> [String] -> String
joinBy _ [] = []
joinBy _ [x] = x
joinBy sep (x:xs) = x ++ sep ++ joinBy sep xs

hms :: Integral a => a -> [a]
hms sec = [sec `div` 3600, sec' `div` 60, sec'']
  where sec' = sec `mod` 3600
        sec'' = sec' `mod` 60

main :: IO ()
main = readLn >>= putStrLn . joinBy ":" . map show . hms