import sequtils, strutils, algorithm, math var s: string = readLine(stdin) twoPair:int reach:seq[char] = @[] proc main() = for i in s: if s.count(i) == 2: twoPair += 1 elif s.count(i) == 1: reach.add(i) else: echo "Impossible" break if len(reach) != 1: echo "Impossible" echo reach[0] main()