import collections S = input() count_S = collections.Counter(S) S_list = list(S) S_set = set(S) if len(S_list)-len(S_set)==6 and 3 not in count_S.values(): for key,value in count_S.items(): if value==1: print(key) else: print("Impossible")