from collections import Counter S = list(input()) S.sort() C = Counter(S) f = False for k, v in C.items(): if v == 1: if not f: f = True res = k else: print('Impossible') break elif v == 2: continue else: print('Impossible') break else: if not f: print('Impossible') else: print(res)