from collections import Counter S = input() C = Counter(S) V = list(C.values()) if V.count(2) == 6 and V.count(1) == 1: for k, v in C.items(): if v == 1: print(k) else: print("Impossible")