from collections import defaultdict S = input() d = defaultdict(int) for s in S: d[s] += 1 cnt = 0 res = 0 for k, v in d.items(): if v == 2: cnt += 1 if v == 1: res = k if cnt == 6: print(res) else: print("Impossible")