s=input() cnt=[0]*26 for c in s: cnt[ord(c)-ord('a')]+=1 one=[] two=0 for i in range(26): if cnt[i]==1: one.append(chr(ord('a')+i)) elif cnt[i]==2: two+=1 if two==6 and len(one)==1: print(one[0]) else: print('Impossible')