text=input("") chars={} for i in range(13): char=text[i] if char in chars: chars[char]+=1 else: chars[char]=1 if len(chars)==7: one=0 result="" other=0 clist=chars.keys() for i,v in enumerate(chars): if chars[v]==1: one+=1 result=v elif chars[v]!=2: other+=1 if other!=0: result="Impossible" elif one!=1: resule="Impossible" else: result="Impossible" print(result)