from collections import Counter S = input() C = Counter(S) ans = None for k, v in C.items(): if ans: if v != 2: print("Impossible") quit() else: if v == 1: ans = k elif v == 2: pass else: print("Impossible") quit() print(ans)