-- Try yukicoder -- author: Leonardone @ NEETSDKASU import qualified Data.Map as Map main = putStrLn . unlines . solve =<< getLine solve xs = ans where xm = foldl f Map.empty xs f a x = Map.insertWith (+) x 1 a ans = map (return.fst) . filter h $ map g ['a' .. 'm'] g c = (c, f xm c) h (c, m) = (13,14) == xx where xx = foldl u (0,0) ['a' .. 'm'] u (a,b) x = case Map.lookup x m of Just k -> (a+1,b+k) Nothing -> (0,0)