from collections import Counter s = input() t = Counter(s) one, pair = 0, 0 for k, v in t.items(): if v == 2: pair += 1 elif v == 1: one += 1 idx = k if pair == 6 and one == 1: print(idx) else: print("Impossible")