import qualified Data.Map.Strict as M type Count = Int type Counter a = M.Map a Count addElement :: Ord a => a -> Counter a -> Counter a addElement x = M.insertWith (+) x 1 buildCounter :: Ord a => [a] -> Counter a buildCounter = foldr addElement M.empty countElem :: Ord a => Counter a -> a -> Count countElem ctr el = M.findWithDefault 0 el ctr isKokushi :: Counter Char -> Bool isKokushi ctr = f 1 == 12 && f 2 == 1 && M.keys ctr == ['a' .. 'm'] where mctr = buildCounter $ M.elems ctr f = countElem mctr solve :: String -> [String] solve s = (: []) <$> filter g ['a' .. 'z'] where g c = isKokushi $ addElement c ctr ctr = buildCounter s main :: IO () main = do s <- getLine let res = solve s if null res then putStrLn "Impossible" else putStr $ unlines res