import sys sys.setrecursionlimit(10 ** 6) stdin = sys.stdin ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) ns = lambda: stdin.readline().strip() ntp = lambda: tuple(map(int, stdin.readline().split())) mod = 10 * 9 + 7 inf = 2 << 60 S = list(ns()) T = set(S) ans = '-1' for t in T: cnt = S.count(t) if cnt == 1: if ans == '-1': ans = t else: print('Impossible') exit() if cnt > 2: print('Impossible') exit() print(ans)