from collections import Counter S=input() C=Counter(S) two=0 one=[] for c in C: if C[c]==2: two+=1 elif C[c]==1: one.append(c) if two==6 and len(one)==1: print(one[0]) else: print("Impossible")