import Data.List main = do s <- getLine maybe (putStrLn "Impossible") (mapM_ putStrLn) (kokushi s) kokushi s = case sort (map length (group (sort s))) of [1,1,1,1,1,1,1,1,1,1,1,1,1] -> Just $ map return "abcdefghijklm" [1,1,1,1,1,1,1,1,1,1,1,2] -> let s' = "abcdefghijklm" \\ s in if length s' == 1 then Just [s] else Nothing _ -> Nothing