s,dic,v=input(),{},[] for c in s: if c not in dic: dic[c]=1 else: dic[c]+=1 for e in dic.values(): v.append(e) v.sort() if v != [1,2,2,2,2,2,2]: print("Impossible") else: for e in dic.keys(): if dic[e]==1: print(e) break