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