S = list(input()) NOT_equal = [] for i in range(len(S)-1): if S.count(S[i]) >= 3: print("Impossible") break if S.count(S[i]) == 1: NOT_equal.append(S[i]) else: if len(NOT_equal) != 1: print("Impossible") else: print(NOT_equal[0])