open System let solve (s : string) = let pairs = Seq.groupBy id s |> Seq.map (fun (c, cSeq) -> (c, Seq.length cSeq)) |> Seq.toList let maxPair = List.maxBy (fun (_, cnt) -> cnt) pairs |> fun (c, cnt) -> cnt if maxPair > 2 then "Impossible" else let single = List.filter (fun (_, cnt) -> cnt = 1) pairs |> List.map (fun (c, _) -> c) if List.length single > 1 then "Impossible" else new String(single.[0], 1) let () = let s = stdin.ReadLine() solve s |> printfn "%s"