S = input() l = list(S) ck = 0 l.sort() l1 = [] flg = 0 for i in l: ck = l.count(i) if ck == 1: l1.append(i) elif ck == 2: pass else: flg = 1 break if len(l1) == 1 and flg == 0: print(l1[0]) else: print("Impossible")