c=[x for x in input()] s=set(c) if len(s)==7 and max([c.count(x) for x in s])==2: for i in s: if c.count(i)==1: print(i) else: print("Impossible")