import collections s=str(input()) count=0 ans=str() for i in range(len(s)): if s.count(s[i])!=2: if s.count(s[i])!=1: print("Impossible") exit() elif s.count(s[i])==1: count+=1 ans=s[i] if count==1: print(ans) else: print("Impossible")