import qualified Data.Map.Lazy as M createStringMap :: String -> M.Map Char Int createStringMap = foldr (\c acc -> M.insertWith (\n o -> o + 1) c 1 acc) M.empty process :: String -> Maybe Char process input | M.size stringMap == 7 && M.size singleMap == 1 = Just $ (M.keys singleMap) !! 0 | otherwise = Nothing where stringMap = createStringMap input singleMap = M.filter (\c -> c == 1) stringMap main :: IO () main = do input <- getLine case process input of Just x -> putStrLn [x] Nothing -> putStrLn "Impossible"