s = input() def find(s): p = [] for i in s: if len(p) >= 2: return 'Impossible' if s.count(i) == 1: p.append(i) if s.count(i) >= 3: return 'Impossible' if len(p) == 1: return p[0] print(find(s))