import Control.Applicative
import Data.List (intercalate)

main = do
        recTime <- map read.words<$>getLine
        if all (==(-1)) recTime then return ()
                                else do
                                    putStrLn $ remTime 1 recTime
                                    putStrLn $ remTime 3 recTime
                                    main

remTime :: Int -> [Int] -> String
remTime n [t,h,s] = intercalate ":".map showTime.secToTHS.(n*).(2*3600 -)$thsToSec t h s
secToTHS sec = [t,h,s]
    where (t,m) = divMod sec 3600
          (h,s) = divMod m   60

thsToSec t h s = 3600 * t + 60 * h + s

showTime :: Int -> String
showTime t = case length $ show t of
                 2 -> show t
                 1 -> '0' : show t