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 judge :: String -> Maybe Char judge s = if not canBuildPairs then Nothing else Just $ head $ M.keys $ M.filter (== 1) charCtr where charCtr = buildCounter s countCtr = buildCounter $ M.elems charCtr canBuildPairs = countElem countCtr 2 == 6 && countElem countCtr 1 == 1 main :: IO () main = do s <- getLine case judge s of Just c -> putChar c Nothing -> putStr "Impossible" putChar '\n'