import Data.List (sort) solve :: String -> String solve s = if x /= 1 then "Impossible" else if (length $ filter (== z) s) > 1 then "Impossible" else y where x = length y y = f $ sort s z = head y f :: String -> String f [] = [] f (x:y:zs) | x == y = f zs | otherwise = x : f (y:zs) main :: IO () main = getLine >>= putStrLn . solve