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