s = input() c = {} for i in s: if not i in c: c[i] = 1 else: c[i] += 1 print(c) x = max(c.values()) if x > 2: print('Impossible') else: l = [] for i in c: if x != c[i]: l.append(i) if len(l) >=2: print('Impossible') else: print(*l)