S = input() from collections import defaultdict dic = defaultdict(int) for s in S: dic[s] += 1 p1 = 0 p2 = 0 ans = "" for key, value in dic.items(): if value == 2: p2 += 1 elif value == 1: p1 += 1 ans = key else: print("Impossible") break else: if p1 == 1: print(ans) else: print("Impossible")