s = ''.join(sorted(list(input()))) p = [] for i in range(7): if len(s)==1: break if s[0]==s[1]: p+=s[0]; s=s[2:] else: s=s[1:]+s[0] if len(s)==1: p+=s print(s if len(set(p))==7 else "Impossible")