import Text.Printf
import Data.Char
import System.Random
clock :: String
clock = unlines
[ " 0"
, " b 1"
, ""
, " a 2"
, ""
, "9 3"
, ""
, " 8 4"
, ""
, " 7 5"
, " 6"]
dac :: String -> String
dac str = map f clock
where
f c | c == hc = 'X'
| c == mc = 'x'
| ord c > 47 = 'o'
| otherwise = c
(h, m) = let (hs, (_:ms)) = span (/=':') str in (read hs, read ms)
hc = intToDigit $ h `mod` 12
mc = let (d, a) = m `divMod` 5 in intToDigit $ if a < 3 then d else d + 1
main :: IO ()
main = mapM_ (putStrLn . f) . (["18:35","00:00","10:03"] ++) =<< makeInput 7
where
f s = "input\n" ++ s ++ "\noutput\n" ++ dac s
makeInput :: Int -> IO [String]
makeInput i = do
hs <- randomRs (0,23) `fmap` newStdGen
ms <- randomRs (0,59) `fmap` newStdGen
return $ take i $ zipWith (\x y -> printf "%02d:%02d" (x::Int) (y::Int)) hs ms