main = solve

solve = do
    allS <- readLn
    (h, allS) <- getHour allS
    (m, allS) <- getMinute allS
    putStrLn $ show h ++ ":" ++ show m ++ ":" ++ show allS

getHour :: Int -> IO (Int, Int)
getHour s = getTime s 3600

getMinute :: Int -> IO (Int, Int)
getMinute s = getTime s 60

getTime :: Int -> Int -> IO (Int, Int)
getTime s x = let t = s `div` x
                  remain = s - (t * x)
              in return (t, remain)