S = list(input()) S.sort() l = len(S) i = 0 count = -1 while True: if i >= l - 1: break p = S.count(S[i]) if p > 2: print("Impossible") exit(0) elif p == 1: if count != (-1): print("Impossible") exit(0) else: count = i i += 1 else: i += 2 print(S[count])